all groups > flash actionscript > december 2004 >
You're in the

flash actionscript

group:

Delay the mouse movie?


Delay the mouse movie? theblessedone
12/28/2004 11:55:10 PM
flash actionscript:
What do I need to add to this code to make the movie item (dragger) follow the
mouse at a delay, and return to a specific X location if the mouse isn't on the
hitTest movie?

onClipEvent(mouseMove){
if(this.hitTest(_root._xmouse, _root._ymouse) == true)
_root.dragger._x = _root._xmouse;
}
Re: Delay the mouse movie? theblessedone
12/29/2004 2:35:12 AM
Thanks for the quick reply!!! The reason I went with this method, was because
I pulled this bit of code from another movie and tinkered with it until it sort
of worked. lol. I had no idea where to start to create this affect.

One other thing though, how would I get it to return to the original position
(500 in the example) at the same rate, from the position it was in when the
mouse left the hitTest movie? Right now it just appears back at that point
when the mouse leaves the range.
Re: Delay the mouse movie? urami_
12/29/2004 9:18:12 AM


[quoted text, click to view]

Making rollOver with a hitTest is kind of overkill , normal roll-over-out
would be much easier. Anyhow

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse) == true) {
_root.dragger._x += (_root._xmouse-_root.dragger._x)/5;
if (!OverThis) {OverThis = 1;}
} else if (OverThis) {
_root.dragger._x =500;
// 500 or whatever cord you want it to be
OverThis = 0;
}
}

--
Happy New Year and all the best to all of you guys !!!


<urami>
http://www.Flashfugitive.com
</urami>


<web junk free>
http://www.firefox.com
AddThis Social Bookmark Button