Help with AS1 to AS2 Conversion

  • GaussianFracture
  • Born
  • Born
  • GaussianFracture
  • Posts: 1

Post 24 days ago

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 also attaching the fla file.

Code: [ Select ]
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;};


Code: [ Select ]
onClipEvent (enterFrame) {
    // We define the reference point
    centerx = _root.Target._x;
    centery = _root.Target._y+50;
    // temporary variables used to calculate
    // the speed of the mass
    x0 = this._x;
    y0 = this._y;
}
onClipEvent (enterFrame) {
    if (pressing) {
        startDrag(this, true);
        xp = this._x-x0;
        yp = this._y-y0;
        x0 = this._x;
        y0 = this._y;
    } else {
        stopDrag();
        this.move(centerx, centery, 0.9, 0.1);
    }
}
  1. onClipEvent (enterFrame) {
  2.     // We define the reference point
  3.     centerx = _root.Target._x;
  4.     centery = _root.Target._y+50;
  5.     // temporary variables used to calculate
  6.     // the speed of the mass
  7.     x0 = this._x;
  8.     y0 = this._y;
  9. }
  10. onClipEvent (enterFrame) {
  11.     if (pressing) {
  12.         startDrag(this, true);
  13.         xp = this._x-x0;
  14.         yp = this._y-y0;
  15.         x0 = this._x;
  16.         y0 = this._y;
  17.     } else {
  18.         stopDrag();
  19.         this.move(centerx, centery, 0.9, 0.1);
  20.     }
  21. }


Thanks.
Attachments:
Elastic Swing Script.rar

(5.57 KiB) Downloaded 1 time

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.