fr_ode
April 12, 2006, 2:06pm
1
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:
fr_ode
April 13, 2006, 9:41am
2
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?
ok ill edit your fla - u better hope its mx2004 cause i aint got f8…
edit: aaaa its not! please post an mx2004 version…
ok - will see what i can do
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;
}
}
fr_ode
April 13, 2006, 7:07pm
9
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 .
fr_ode
April 13, 2006, 7:21pm
11
the script isn’t working. syntaxt error.
fr_ode
April 13, 2006, 7:36pm
12
each part seems to have three “(” and only two “)”, but it would not work when I added one more.
fr_ode
April 13, 2006, 7:54pm
13
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:)