Wednesday, 23 September 2009

wheel rotation action script

this.onEnterFrame=function(){
wheel_mc._rotation+=5;
wheel_mc._x+=5;
}


var dir:Number=0;

right, 1 - move ro the left*/
wheel_mc._x=35;

this.onEnterFrame=function(){
if (dir==0){
wheel_mc._rotation+=5;
wheel_mc._x+=5;
if (wheel_mc._x==470){
dir=1;
}
}
if (dir==1){
wheel_mc._rotation-=5;
wheel_mc._x-=5;
if (wheel_mc._x==35){
dir=0;
}
}
}

// have fun!

No comments: