Copy link to clipboard
Copied
Hello.
I have a flash file that was saved with flash5 to work on AS1. I need it to get it working with Flash8 and AS2, but when I change the publish settings to Flash8 it doesn't work. Can you help me get it working for AS2 ?
I'm posting the scripts below :
MovieClip.prototype.move = function (centerx, centery, inertia, k) { x = -this._x+centerx;y = -this._y+centery;xp = xp*inertia+x*k;yp = yp*inertia+y*k;_x += xp;_y += yp;};
store the prev frame value in a variable. that variable will be available in the next (and all subsequent) frames.
eg, for a movieclip mc:
prev frame
mc.prevX=mc._x;
subsequent frame
var diffX:Number=mc_x-mc.prevX;
Copy link to clipboard
Copied
are those clipevents attached to two different movieclips?
Copy link to clipboard
Copied
Yesb ut I think I sorted it out. I need help with a different issue.
How would I find an objects difference in _x position of the current frame and the _x position of the previous frame? So I can subtract those values and figure out how much it moved in one frame.
Copy link to clipboard
Copied
store the prev frame value in a variable. that variable will be available in the next (and all subsequent) frames.
eg, for a movieclip mc:
prev frame
mc.prevX=mc._x;
subsequent frame
var diffX:Number=mc_x-mc.prevX;
Copy link to clipboard
Copied
Alright thanks, this should work.
Copy link to clipboard
Copied
you're welcome.
(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)