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

flash actionscript : Movie follwing my cursor


tommy cooper
4/5/2006 9:03:34 PM
:confused;
I have seen a movie that follows a cursor on the following site
http://www.tbwa.com/ on the home page
Can you please give some instructions and advice on how I can do something
similar ?? /
All I need to know is how I would get the movie clip to follow the cursor..
Sample code would be useful

thanks T
kglad
4/5/2006 11:03:29 PM
try:


Mouse.hide();
moveI=setInterval(moveF,40);
function moveF(){
yourMC._x=_root._xmouse;
yourMC._y=_root._ymouse;
tommy cooper
4/8/2006 7:04:39 PM
No I'm not looking to hide the mouse !

Please take a look at http://www.tbwa.com/ and see what I want to do on the
home page. They have a movie that contains the navigation which moves to where
the mouse is ? Thats what I need to do ? :confused;
abeall
4/8/2006 7:17:53 PM
well then just take out the Mouse.hide(), right?

kglad
4/8/2006 8:26:02 PM
i don't think that menu's movement looks good. i'd use easing to have the menu
ease-in to the mouse's location:




moveI=setInterval(moveF,40,.95); // the closer speed is to 1, the slower the
ease-in. the closer to zero, the faster the ease-in.
function moveF(speed){
yourMC._x=speed*yourMC._x+(1-speed)*_root._xmouse;
yourMC._y=speed*yourMC._y+(1-speed)*_root._ymouse;
}
tommy cooper
4/11/2006 6:51:48 PM
:D

tommy cooper
4/11/2006 8:19:44 PM
:confused;
http://www.esta-media.com/test.html

I have used your script and yes the movie is following my mouse.

But, as you can see from the attached URL, I have a small problem when the
movie is at the bottom or the right hand side of the screen as the buttons that
appear below cant be seen ??

Can you advise or let me have some script that will ensure that wherever the
movie is on the screen it re-positions itself so that my buttons below can be
seen ??

http://www.esta-media.com/test.html

The original FLA file is available at www.esta-media.com/test.fla

Hope you can assist me.

Thanks
kglad
4/12/2006 1:35:03 AM
you have a bigger problem than that. you really shouldn't have the menu move,
at all, when the mouse is over it. otherwise, it's going to be pretty
frustrating to click on one of those buttons.

anyway, you should restrict that menu from moving outside the rectangle where
your buttons are off-stage. for example:


tommy cooper
4/12/2006 7:20:06 PM
kglad
4/12/2006 8:07:26 PM
tommy cooper
4/13/2006 7:27:47 PM
:)

EXCELLENT..AGAIN

Thanks for taking time out to help me.. I really appreciate it..


Enjoy Easter..

Take a look at a site I've found.. Really cool use of flash in the VIP Lounge
of the airport.. www.v1fly.com
kglad
4/14/2006 1:48:30 AM
AddThis Social Bookmark Button