PDA

View Full Version : Animation in actionscript/rotation


djc
12-07-2002, 03:42 AM
I know there are a couple tutorials out there for animation in actionscript which are all in intermediate; however, I'm new to actionscript/flash in general. Is there a method of actionscript animation that beginners can do? In particular, I would like to be able to do a looping rotation of a circular graphic with actionscript so it is smoother than tweening.

Billy T
12-08-2002, 11:57 AM
make the image an mc and put this on it

onClipEvent(enterFrame){
_rotation+=5;
if(_rotation==360){
_rotation=0;
}
}

don't even need the if statement...


here's a basic tute - http://www.tableau.com.au/tutorials/animate_actionscript/index.html

cheers

birail
11-09-2003, 03:37 PM
I'm trying to make a rotation movment , something like the windows hourglass
any idea on how I could insert a code on this:


onClipEvent(enterFrame){
_rotation+=5;
if(_rotation==360){
_rotation=0;
}
}


so on 180 to stop and wait for a while, after that to continue play until 360.Then stop for a while, and after that to continue until 540....an so on...

thnx
chris

Billy T
11-09-2003, 05:25 PM
well it would probably be easier just to tween it but try


onClipEvent(load){
ok2rotate=true;
i=0;
}
onClipEvent(enterFrame){
if(ok2rotate){
_rotation+=5;
}
if(_rotation==180){
ok2rotate=false;
i++;
if(i>100){
ok2rotate=true;
i=0;
}
}
if(_rotation==360){
ok2rotate=false;
i++;
if(i>100){
ok2rotate=true;
i=0;
_rotation=0;
}
}
}


cheers

birail
11-09-2003, 07:59 PM
thnx man ! u really helped :)

Billy T
11-10-2003, 03:24 AM
no problem