Following menu - problem

Hi. I’ve been trying to figure this out a while now, but I can’t find a good solution.

I need to be able to use the buttons, but when the menu keeps easing towards the mouse it’s hard to reach them.
Is it possible to stop the easing once the mouse x and y is eaqual to the menu x and y? And start the easing again on rollOut? How do I do this?

:hoser:

please forgive me for bumbing this. bump

bumbing :lol:

do u mean if the mouse is within a certain vicinity of the menu then stop the menu still?

yeah. :]

ok ill edit your fla - u better hope its mx2004 cause i aint got f8…

edit: aaaa its not! please post an mx2004 version…

here u go:disco:

ok - will see what i can do :wink:

Just tell it to perform a move function if the mouse is outside of the button MC’s width and height. Otherwise it doesn’t follow.


//lower the number faster the movement
speed = 4;
onEnterFrame = function(){
//for x
     if((_xmouse > buttons._x + (buttons._width/2)) || ((_xmouse<         buttons._x - (buttons._widtht/2)){
                buttons._x += (_xmouse - buttons._x)/speed;
     }
//for y
 if((_ymouse > buttons._y + (buttons._height/2)) || ((_ymouse<         buttons._y - (buttons._height/2)){
                buttons._x += (_ymouse - buttons._y)/speed;
     }
}

thanks a lot, really:rock: but honestly - this is not quite what I meant.

I need it to stop when the mouse reaches the center of the menu mc, and “start” moving again when it leaves the whole menu.

Just use hittest

the script isn’t working. syntaxt error.

each part seems to have three “(” and only two “)”, but it would not work when I added one more.

allright. I think I’ve figured out the syntax:

//lower the number faster the movement
speed = 4;
onEnterFrame = function(){
//for x
	if((_xmouse > buttons._x + (buttons._width/2)) || (_xmouse < buttons._x - (buttons._width/2))){
		buttons._x += (_xmouse - buttons._x)/speed;
     }
//for y
	if((_ymouse > buttons._y + (buttons._height/2)) || (_ymouse < buttons._y - (buttons._height/2))){
		buttons._x += (_ymouse - buttons._y)/speed;
     }
}

however, the effect isn’t quite as intended (check attachment).

and where do the hittest go?

I am a total newbie, and my english is terrible. thanks for any help:flower:

Sorry wrong thread…didn’t mean to confuse you:)