Loading a image
I am trying to load an image 12 times
Every time it spins and the number is between 1 and 30 show this image, 30-60 show this image and so on, 60 - 90 etc
In the function spin() I need to say if >30 and <60 show this image.
Anyone can help?
onClipEvent (load) {
num = Math.round(Math.random()*360);
targetRotation = num;
spinCount = 4;
targetRotation += spinCount*360;
spinSpeed = spinCount*20;
currentRotation = this._rotation;
function spin() {
dr = targetRotation-currentRotation;
// (targetRotation + " : " + currentRotation + " : " + dr);
currentRotation += dr/spinSpeed;
this._rotation = currentRotation;
if (dr<=165) {
this._rotation = num-164;
}
}
}
onClipEvent (enterFrame) {
spin();
}
I am trying to load an image 12 times
Every time it spins and the number is between 1 and 30 show this image, 30-60 show this image and so on, 60 - 90 etc
In the function spin() I need to say if >30 and <60 show this image.
Anyone can help?
onClipEvent (load) {
num = Math.round(Math.random()*360);
targetRotation = num;
spinCount = 4;
targetRotation += spinCount*360;
spinSpeed = spinCount*20;
currentRotation = this._rotation;
function spin() {
dr = targetRotation-currentRotation;
// (targetRotation + " : " + currentRotation + " : " + dr);
currentRotation += dr/spinSpeed;
this._rotation = currentRotation;
if (dr<=165) {
this._rotation = num-164;
}
}
}
onClipEvent (enterFrame) {
spin();
}