# Flash AS3 Preloader

**URL:** <https://forum.kirupa.com/t/flash-as3-preloader/310250>\
**Category:** flash\
**Created:** [June 5, 2010, 6:02pm UTC](https://forum.kirupa.com/t/flash-as3-preloader/310250 "2010-06-05T18:02:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siremorgan](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@siremorgan](https://forum.kirupa.com/u/siremorgan)\
**Post date:** [June 5, 2010, 6:02pm UTC](https://forum.kirupa.com/t/flash-as3-preloader/310250/1 "2010-06-05T18:02:02Z")

</div>

Hey Guys,

I’ve been trying to get this preloader working for days! I finally got it working, and now when i upload it to my site and refresh the page, the .swf file is stuck at the preloader screen.

This is my code:

```auto
 
//Stop Frame
stop();
//Create a listener to call the loading function as the movie loads
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, loading);
//Runs when the loading progress has changed
function loading(event:ProgressEvent):void
{
//Determine the percent loaded from bytesLoaded and bytesTotal
var percent:Number = event.bytesLoaded / event.bytesTotal * 100;
//Stretch a progress bar
progressBar.scaleX = percent / 100;
//Set the progressText text box to the percent loaded
progressText.text = int(percent) + "%";
//When the load is finished, go to frame 2
if(percent == 100)
{
this.gotoAndStop(2);
}
}

```

I’ve been reading up on it for a while now, but I can’t seem to figure it out. I’d really appreciate it if I can get some advice as to what to do.
