PDA

View Full Version : execute as long as mouse is over a movie clip


quinu
01-17-2003, 05:08 PM
I am trying to make my movie clip run away as long as the mouse is over it, and stop when the mouse is no longer over the clip. I put an invisible button inside the clip and I wrote the following,




on (rollOver) {
this._x-=10;
_root.next_btn._visible = true;
}


The problem is that it only executes once. How can I make it continuously decrement as long as the mouse is over the clip?

annexion
01-17-2003, 06:51 PM
Make it into a movieclip and give it this actionscript:

onClipEvent(enterFrame){
if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
this._x-=5;
_root.next_btn._visible = true;
}
}

quinu
01-17-2003, 07:12 PM
annexion,

2 things:

1) Thanks for the help. It works like a charm and I actually understand your code which means I must be getting better.

2) Thanks for your tag line. It's nice to see humility.

annexion
01-17-2003, 08:19 PM
And thanks for appreciating the signature line... Some people can't and don't.

Good luck.