# Preloader code

**URL:** <https://forum.kirupa.com/t/preloader-code/318049>\
**Category:** Uncategorized\
**Created:** [January 9, 2011, 2:39pm UTC](https://forum.kirupa.com/t/preloader-code/318049 "2011-01-09T14:39:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkjfman](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@darkjfman](https://forum.kirupa.com/u/darkjfman)\
**Post date:** [January 9, 2011, 2:39pm UTC](https://forum.kirupa.com/t/preloader-code/318049/1 "2011-01-09T14:39:53Z")

</div>

```auto

[COLOR=#000000]stop();

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

text_mc.fill_mc.scaleX = loaded/total;

if (total == loaded){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}

}
[/COLOR]

```

This is one of the many codes I’ve tried and for some reason the preloader isn’t acting as one, it’s just another frame.

Am I missing something?

I’ve also had “progressevent” and “event.complete” and still nothing. I keep getting the 4 default dots as the preloader when I stimulate download.
