# AS3 Image fill preloader

**URL:** <https://forum.kirupa.com/t/as3-image-fill-preloader/321507>\
**Category:** flash\
**Created:** [April 21, 2011, 12:00pm UTC](https://forum.kirupa.com/t/as3-image-fill-preloader/321507 "2011-04-21T12:00:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robinsnuggs](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@robinsnuggs](https://forum.kirupa.com/u/robinsnuggs)\
**Post date:** [April 21, 2011, 12:00pm UTC](https://forum.kirupa.com/t/as3-image-fill-preloader/321507/1 "2011-04-21T12:00:06Z")

</div>

hi all,

Im somewhat a newbie to as3, ive tried making a image fill preloader using masks etc. When publishing its just showing my preloader not continuing to my content. which is on frame 11. I was wondering if anyne can help me with code?

cheers

stop();  
mask\_mc.DisplayObject.height = 1;

this.addEventListener(Event.ENTER\_FRAME, loading);  
function loading(e:Event):void{  
var loadedData:Number = this.LoaderInfo.bytesLoaded();  
var allData:Number = this.LoaderInfo.bytesTotal();  
var percent:Number = Math.round(loadedData / allData \* 100);  
mask\_mc.DisplayObject.scaleY = percent;  
if (loadedData \>= allData) {  
gotoAndPlay(11);  
this.removeEventListener(Event.ENTER\_FRAME, loading);  
}  
}

i have placed this on frame one where just preloader content is, then all content frames start at frame 11. any help would be much appreciated.
