# Preloader works but will not run the rest of my Flash file?

**URL:** <https://forum.kirupa.com/t/preloader-works-but-will-not-run-the-rest-of-my-flash-file/312556>\
**Category:** flash\
**Created:** [August 6, 2010, 12:12pm UTC](https://forum.kirupa.com/t/preloader-works-but-will-not-run-the-rest-of-my-flash-file/312556 "2010-08-06T12:12:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spiderq](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@spiderq](https://forum.kirupa.com/u/spiderq)\
**Post date:** [August 6, 2010, 12:12pm UTC](https://forum.kirupa.com/t/preloader-works-but-will-not-run-the-rest-of-my-flash-file/312556/1 "2010-08-06T12:12:44Z")

</div>

I hope someone can point out the basic error in this code ( which I found elsewhere on the 'net)

My Preloader works fine when I preview in Download mode BUT only loads the first frame of animation.I have attached my file- just a simple image fade ( it has a lot more images but no space here!)

Can someone please help? Thanks!

Here is the code in the Actions layer:

```auto

stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onWatch);
this.loaderInfo.addEventListener(Event.COMPLETE, onTotal);

function onWatch(event:ProgressEvent):void
{
var load:Number = event.target.bytesLoaded;
var total:Number = event.target.bytesTotal;
var percent:Number = load/total;
loadAmt.text = "Downloading.."+(Math.round(percent * 100)) + "%";
load_Ani.scaleX = percent;
}

function onTotal(event:Event):void
{
nextFrame();
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onWatch);
this.loaderInfo.removeEventListener(Event.COMPLETE, onTotal);
}

```
