A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Help with mouse cursor replacing

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Posts
    259

    Help with mouse cursor replacing

    OK I've been successful in replacing my mouse cursor with a movieclip I made.
    Problem is, I have several movies on the site, each on on a different level, and the cursor's movieclip loads underneath them...how can I force it to load on top of everything?
    Also, the site resides in one HTML which has a table. This table has a top section and a bottom section. Each section holds two different main SWFs. The mouse only works in the section it is replaced. How do I make it so that the cursor stays changed across the whole site?
    Up the Irons!!

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Also, I wanted to make four different cursors, and replace the mouse cursor randomly. Any thoughts on how?
    Up the Irons!!

  3. #3
    I am not an expert
    Join Date
    Aug 2005
    Posts
    175
    well u have to do one thing first that keep all ur movieclip which u want to use as curson and put the same code on each of them also u need to switch the depth of this movieclip to next highest avalable depth do the following

    Mouse.Hide(); // on main time line

    on movieclip
    onClipEvent(load){
    _root.createEmptyMovieClip("muymc", _root.getNextHighestDepths());
    }
    onClipEvent(mouseMove){
    this.swapDepth(_root.mymc);
    this._x = _xmouse;
    this._y = _ymouse;
    }

    put this code on all the four movie clip and copy this movieclip to all ur four flash fla well this will solve ur problem

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    mmm
    That ALMOST solved the problem.
    The thing is, I don't have four different FLAs, I'm using just one, I need it to randomly choose a cursor each time it is loaded.
    Up the Irons!!

  5. #5
    The Flash AS Newb
    Join Date
    May 2006
    Location
    Australia
    Posts
    179
    you could do this on the main time line

    var cursor:Number = Math.round(Math.random() *3);

    like on the first frame what this does is gets a random whole number between 0 - 3 giving the possible outcomes of 0,1,2 and three

    make an if event saying something like

    if(cursor == 0){
    code for cursor 1 here
    }else if(cursor == 1{
    code for cursor 2 here
    }else if(cursor == 2{
    code for cursor 3 here
    }else{
    code for cursor 4 here
    }


    so everytime the program loads it will give a different random number giving you a different cursor hope this helps

  6. #6
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Yes!
    Solved it. Thanks!
    Up the Irons!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center