# Preloader not working in MX

**URL:** https://forum.kirupa.com/t/preloader-not-working-in-mx/1771
**Category:** Uncategorized
**Created:** [May 27, 2002, 7:00pm UTC](https://forum.kirupa.com/t/preloader-not-working-in-mx/1771 "2002-05-27T19:00:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 27, 2002, 7:00pm UTC](https://forum.kirupa.com/t/preloader-not-working-in-mx/1771/1 "2002-05-27T19:00:49Z")

</div>

I know this sounds weird, but I can’t get the dam thing to work. I used the exact same code with flash 5, but its not working in MX. I tried the code with and without the “\_root.” just to make sure…

Frame 1 of Main Timeline::

nTotal = \_root.getBytesTotal()/1000  
nLoaded = \_root.getBytesTotal()/1000  
nPercent = \_root.Math.round(nLoaded/nTotal)  
nRemain = \_root.Math.round(nTotal - nLoaded)  
if (nLoaded \>= nTotal && nLoaded != 0){  
&nbsp &nbsp &nbsp &nbsp gotoAndPlay(4)  
}  
\_root.loader.\_xscale = nPercent  
nRead = nPercent+"%"

Frame 3 of Main Timeling::  
\_root.gotoAndPlay(1)

and in Frame 4 is the image that is going to be loaded.

Now, what I don’t understand is with Flash MX, instead of it going to frame 1, and looping, it goes to frame 3, and stops. It just stays there. And the rest of the Bytes load, but it just stays there even after its all loaded.

The really strange thing is that I have a box in the 3rd layer that is in Frames 1-3 and I also have text and a dynamic text box in the 4th layer that is in all three frames as well, and nothing shows up, just the orange background… If anyone sees a problem in my code let me know.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 27, 2002, 9:26pm UTC](https://forum.kirupa.com/t/preloader-not-working-in-mx/1771/2 "2002-05-27T21:26:24Z")

</div>

‘nLoaded’ is set improperly:  
it says:  
nLoaded = \_root.getBytesTotal()/1000  
and it should say:  
nLoaded = \_root.getBytesLoadedl()/1000

🙂  
jeremy

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 27, 2002, 9:30pm UTC](https://forum.kirupa.com/t/preloader-not-working-in-mx/1771/3 "2002-05-27T21:30:58Z")

</div>

Ok thanks. I always miss something in my code. My debugging skills need a lil’ bit o’ work. Thanks Sinf.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 27, 2002, 10:42pm UTC](https://forum.kirupa.com/t/preloader-not-working-in-mx/1771/4 "2002-05-27T22:42:16Z")

</div>

nLoaded = \_root.getBytesLoadedl()/1000 ??  
I’d say \*\* Loaded\*\*, not Loaded\*\* l\*\* :rollin:

pom 0]
