PDA

View Full Version : mouse tracker



hiatus
July 29th, 2003, 11:13 AM
well i'm not that good at FMX AS cos i just started with it and i haf a problem:

I can create a double axis cursor and i want to have a tracker to trace the _x and _y values of my cursor but i'm not sure of the script...i only have a rough pseudo script in my mind, anyone help me out here?

m_andrews808
July 29th, 2003, 11:18 AM
hmm... well the wy the script looks really depends on how you want your mouse tracker to move, try this to kick off with:

(say your mouse tracker is a movie clip on the _root timeline called 'Tracker')
put this code (FMX) in the frame where your tracker clip is placed:


Tracker.onEnterFrame = function() {
Tracker._x += (_xmouse - _x) / 10;
Tracker._y += (_ymouse - _y) / 10;
}


hope this is something like what you are after ;) :P

thoriphes
July 29th, 2003, 11:19 AM
this might help you out.

on the first frame of your movie insert this code:
onEnterFrame = function () {
trace("X: "+_root._xmouse+" Y: "+_root._ymouse);
};