PDA

View Full Version : Flash 8 Actionscript help



Jacobdm0
04-17-2008, 09:18 PM
I need the actionscript code for a cursor...

There will be three parts to the cursor.

One part of the cursor will constantly on the mousepoint,
another part will take 10 frames to move to the mousepoint,
and the last part will take 20 frames to move the the mousepoint.

For the two parts with the delay, They should always be moving towards the mousepoint, but the further away it is from the mousepoint, the faster it moves.

Miitchyy
04-20-2008, 03:07 PM
one always on it:
onClipEvent(load) {
startDrag("", true);
}

others
onClipEvent(enterFrame) {
var framesTil = 20; //Change for how many frames to reach mouse
this._x = this._x - ((this._x - _root._xmouse) / framesTil);
this._y = this._y - ((this._y - _root._ymouse) / framesTil);
}