Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mousetrack 2

Status
Not open for further replies.

guytoon

Technical User
Jun 5, 2002
54
GB
Hi y'all
Many thanks to Diane and OldNewbie for their support.Unforunately because we are Mac based we couldn't open the .fla! Does anyone know how to get an object to follow the mouse? Peace
 
like this:

Code:
onClipEvent(enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Regards
David Byng
spider.gif

davidbyng@hotmail.com
 
...or this, which kind of hunts the mouse down gradually...

Flash 5 (attach directly to the object):

onClipEvent(enterFrame) {
_x += (_root._xmouse-_x)/20;
_y += (_root._ymouse-_y)/20;
}

...or MX (place code in frame one, main timeline, object's instance name is 'clip'):

this.onEnterFrame = function() {
clip._x += (_xmouse-clip._x)/20;
clip._y += (_ymouse-clip._y)/20;
};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top