# Animated Preloader: Advance 1 frame every 10% loaded? (AS3)

**URL:** https://forum.kirupa.com/t/animated-preloader-advance-1-frame-every-10-loaded-as3/295785
**Category:** flash
**Created:** [September 4, 2009, 5:27am UTC](https://forum.kirupa.com/t/animated-preloader-advance-1-frame-every-10-loaded-as3/295785 "2009-09-04T05:27:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![digs20](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@digs20](https://forum.kirupa.com/u/digs20)
#### Post date: [September 4, 2009, 5:27am UTC](https://forum.kirupa.com/t/animated-preloader-advance-1-frame-every-10-loaded-as3/295785/1 "2009-09-04T05:27:27Z")

</div>

Hi all, this is my first post ever:

I am needing to create a preloader that advances a 10 frame animation every 10% loaded. So there will be a percentage indicator (dynamic text) and a short animation as the load bar (10 frames).

The animation is of tape winding into a tape measure, and when it’s fully inside the loading is complete and timeline moves onto next frame.

I have been able to do this with AS2, using a combination of (stop) and (play) commands whenever the next 10% was loaded.

Here’s that code:

\_root.loadPerFrame = 0.1;  
\_root.roll.onEnterFrame = function(){  
\_root.percLoaded = Math.round((\_root.getBytesLoaded()/\_root.getBytesTotal())\*100)+"%";  
if(\_root.preloaderStart){  
\_root.roll.stop();  
if ((\_root.getBytesLoaded()/\_root.getBytesTotal()) \>= \_root.loadPerFrame){  
\_root.\_root.loadPerFrame += 0.1;  
\_root.roll.play();  
}  
}  
if((\_root.getBytesLoaded()/\_root.getBytesTotal())\>=1){  
play();  
percLoadMC.\_alpha = 0;  
}  
}

Any help with this in AS3?
