# Preloader not working

**URL:** <https://forum.kirupa.com/t/preloader-not-working/326515>\
**Category:** Uncategorized\
**Created:** [December 20, 2011, 2:55pm UTC](https://forum.kirupa.com/t/preloader-not-working/326515 "2011-12-20T14:55:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DKaikster](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@DKaikster](https://forum.kirupa.com/u/DKaikster)\
**Post date:** [December 20, 2011, 2:55pm UTC](https://forum.kirupa.com/t/preloader-not-working/326515/1 "2011-12-20T14:55:00Z")

</div>

I’ve created a preloader for external sounds. It runs fine when I test movie. I tried testing with “Simulate Download”.

Here’s the problem, the snd\_loader\_text is the instance name of a dynamic text field. But the progress does not appear there. It’s only blank when I simulate download or even put my work online. But the trace(snd\_loader\_txt.text); shows the changing values perfectly. Why are they not showing? No. 2. It seems to work fine when I simulate download but it keeps loading forever when I place it online. Please help.

stop();

var soundClip:Sound = new Sound();  
var soundChannel:SoundChannel = new SoundChannel();

var soundPlaying:int = 0;

soundClip.load(new URLRequest(“TheMorning.mp3”));  
soundClip.addEventListener(ProgressEvent.PROGRESS, soundLoading);

function soundLoading(e: ProgressEvent):void  
{  
snd\_loader\_txt.text = int(e.bytesLoaded/e.bytesTotal\*100) + “%”;  
trace(snd\_loader\_txt.text);

```
if (e.bytesTotal == e.bytesLoaded)
{
    play();
    this.removeEventListener(Event.ENTER_FRAME, loading);
}

```

}
