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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pre loader size / animation

Status
Not open for further replies.

styleBunny

Technical User
Jun 20, 2002
133
AU
hi folks
i have this pre loading animation, created with a mask.
Sadly the shape tween wouldnt work its majic so is all key frames :(, using this movie as my preloader blows frame 1 out to 75kb. Does anyone have an idea how i might bring it down a notch or two?

Also i wanted the animation to tween in sync with the bytes loaded, so at 100& its as burnt all the way through, any ideas? i know you can change the _x, _y _width etc based on the getBytesLoaded , is there away to corelate it to the fram number of a movie?

p.
 
If you make the animation 100 frames long you can use the percentage value generated by the bytesLoaded code to send the animation to the appropriate frame:

var percent=Math.ceil((getBytesLoaded()/getBytesTotal())*100);
animation.gotoAndStop(percent);

If you don't have a 100 frame long animation you'll have to add an extra calculation to work out the frame to goto (a 200 frame animation would require a goto to percent*2 etc) but the principle is the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top