I have a mc that slides in when the mouse is over it, using a hittest. heres the code:
onClipEvent (load) {
this._x = 670;
vel = 10
}
onClipEvent (enterFrame) {
if(this.hitTest(_root._xmouse,_root._ymouse,true))
_root.newy = 412;
else
_root.newy = 630;
fukx += (_root.newy-_x)/vel
_x = Math.round(fukx);
}
the reason im not using rollOver is that there are other rollOvers within the mc and 2 in one mc conflict.
i want to execute a function when hittest is detected, instead of using the
fukx += (_root.newy-_x)/vel
_x = Math.round(fukx);
for the movement. so the code would become:
onClipEvent (enterFrame) {
if(this.hitTest(_root._xmouse,_root._ymouse,true))
runThisFunction();
else
runAnotherFunction();
}
the only problem with this is that the code within the function loops indefinately when used with hittest. How can i tell flash to just run the code within the function once?
Thanks!