Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to load an image

Status
Not open for further replies.

wrighterb

Programmer
Feb 20, 2007
80
US
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();

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top