# Preloader not appearing until late

**URL:** <https://forum.kirupa.com/t/preloader-not-appearing-until-late/289461>\
**Category:** Uncategorized\
**Created:** [May 30, 2009, 10:51pm UTC](https://forum.kirupa.com/t/preloader-not-appearing-until-late/289461 "2009-05-30T22:51:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryrocks](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryrocks](https://forum.kirupa.com/u/ryrocks)\
**Post date:** [May 30, 2009, 10:51pm UTC](https://forum.kirupa.com/t/preloader-not-appearing-until-late/289461/1 "2009-05-30T22:51:32Z")

</div>

I have a Flash game which holds all of its content in a single keyframe on the stage. I have one keyframe before this which contains the preloader using the following script:

```auto

stop();

this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onProgress(e:ProgressEvent):void
{
	var loaded:Number = e.target.bytesLoaded;
	var total:Number = e.target.bytesTotal;
	var pct:Number = loaded/total;
	loader_mc.scaleX = pct;
	loaded_txt.text = "Loading... " + (Math.round(pct * 100)) + "%";
}

function onComplete(e:Event):void
{
	nextFrame();
}

```

The preloader seems to be coded correctly. The problem is that when I upload the file to the web there is a long delay before even the preloader appears. It eventually does appear at about 90%. It continues to load up to 100% then the game starts as required.

I obviously want the preloader to start playing from 1%, its like the swf is trying to load all of the graphic before the preloader loads. I have multiple classes, would this cause the problem?
