Tutorial Navigation
 

     
 Links
 

 
.

 

 Search         Date   
      

SwishMax
:  Dynamic Move / Resize, 
July 31, 2004  -  by Pemtium  


Dynamic Move and Resize for any Object.

This is the Code needit for the OBJECT.
onLoad () {
    hspeed = 0;
    wspeed = 0;   
    xspeed = 0;
    yspeed = 0;  
    smooth = 0.1;
    elasticity = 0.75;
    TARGETH = _height;
    TARGETW = _width;
    TARGETX = _x;
    TARGETY = _y;   
}
onEnterFrame() {
     hspeed = ((TARGETH - _HEIGHT)*smooth )+( hspeed*elasticity );
    _height += hspeed;
     wspeed = ((TARGETW - _WIDTH)*smooth )+( wspeed*elasticity );
    _WIDTH += wspeed;
     xspeed = ((TARGETx - _x)*smooth )+( xspeed*elasticity );
    _x += xspeed;
     yspeed = ((TARGETy - _y)*smooth )+( yspeed*elasticity );
    _y += yspeed;
}

If you need to resize X or Y, or you need to move Dynamicly you will use this sentences:
_root.OBJECT.TARGETW=nn to change Width
_root.OBJECT.TARGETH=nn to change Height

_root.OBJECT.TARGETX=nn  to move to X position
_root.OBJECT.TARGETY=nn  to move to Y Position

You could use 1 or all at the same time.

    Total Download: 89 Last Download: 10/01/2010

.

     
 Featured Links