Guest User

Untitled

a guest
Jun 26th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onClipEvent (data) {
  2.     var originalXLoc = this._x;
  3. }
  4.  
  5.  
  6.  
  7.  
  8.  
  9. count = int(this.name);
  10.     if (count<90) {
  11.    
  12.    
  13.    
  14.    
  15.    
  16.     if (count>90) {
  17.         var xLoc = 685.4;
  18.         var yLoc = 68.4;
  19.         var xDist = Math.abs(xLoc-this._x);
  20.         var yDist = Math.abs(yLoc-this._y);
  21.         var xRate = xDist/3;
  22.         var yRate = yDist/3;
  23.         if (this._x>xLoc) {
  24.             this._x -= xRate;
  25.             if (this._x<xLoc) {
  26.                 this._x = xLoc;
  27.                 this._y = yLoc;
  28.             }
  29.         } else {
  30.             this._x += xRate;
  31.             if (this._x>xLoc) {
  32.                 this._x = xLoc;
  33.                 this._y = yLoc;
  34.             }
  35.         }
  36.         if (this._y>yLoc) {
  37.             this._y -= yRate;
  38.             if (this._y<yLoc) {
  39.                 this._y = yLoc;
  40.                 this._x = xLoc;
  41.             }
  42.         } else {
  43.             this._y += yRate;
  44.             if (this._y>yLoc) {
  45.                 this._y = yLoc;
  46.                 this._x = xLoc;
  47.             }
  48.         }
  49.     }
  50.     this.name = ++count;
  51. }
Add Comment
Please, Sign In to add comment