Groups | Blog | Home
all groups > flash actionscript > april 2007 >

flash actionscript : Help With MC Following Cursor


NickTheNameless
4/16/2007 11:33:15 PM
Here's the AS I'm using....
myInterval = setInterval (moveMask,50);

function moveMask () {
MYmovieClip._x -= (FMipodGenInfoServStrat._x - _xmouse)/2;
MYmovieClip._y -= (FMipodGenInfoServStrat._y - _ymouse)/2;
}

This makes the clip follow the cursor at the desired speed. I need to take
this effect one step further and have the clip appear (and follow the mouse
cursor) as part of the over state of a button. I only want this clip to show
up when the cursor is over a button, and for that clip to follow the cursor
while it is showing.

Any help is much appreciated.
B
4/17/2007 12:15:53 AM
Select your movie clip and place the following code in you ActionScript window:

onClipEvent(load) {
movieClipInstanceName._visible = false;
}

Then in the button event place the following code:

movieClipInstanceName._visible = true;
AddThis Social Bookmark Button