# Preloader problems

**URL:** <https://forum.kirupa.com/t/preloader-problems/94726>\
**Category:** Uncategorized\
**Created:** [November 16, 2003, 12:07am UTC](https://forum.kirupa.com/t/preloader-problems/94726 "2003-11-16T00:07:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspecial](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pspecial](https://forum.kirupa.com/u/pspecial)\
**Post date:** [November 16, 2003, 12:07am UTC](https://forum.kirupa.com/t/preloader-problems/94726/1 "2003-11-16T00:07:49Z")

</div>

Just created a preloader using one of the tuts here. Worked great in my main timeline however, upon nesting it in a movie clip… it seems to be broken.

I put the same preloader in the 1st 2 frames of my movie clip which is located in the first frame of my main timeline.

Here’s the code I’m using:

//-----------

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadText = Math.round(getPercent\*100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

//-----------

Why wont it work nested in a MC??

---

<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:** [November 16, 2003, 4:20pm UTC](https://forum.kirupa.com/t/preloader-problems/94726/2 "2003-11-16T16:20:50Z")

</div>

Okay, I AM preloading something: the 1st frame of my movie. It has a movie clip that has a preloader nested on ITS time line. I’m sure that this can be done without resorting to loading an external file. I just dont know exactly where to put the code and how to target getBytesLoaded and getBytesTotal.

As of right now I have this code in the 1st frame of my movie clip called “start\_mc”.

//-------------

bytes\_loaded = Math.round(\_root.start\_mc.getBytesLoaded());  
bytes\_total = Math.round(\_root.start\_mc.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
\_root.start\_mc.loadText = Math.round(getPercent\*100)+"%";  
if (bytes\_loaded == bytes\_total) {  
\_root.start\_mc.gotoAndPlay(3);  
}

//--------------

Do you notice anything wrong with this code??

---

<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:** [November 16, 2003, 5:46pm UTC](https://forum.kirupa.com/t/preloader-problems/94726/3 "2003-11-16T17:46:12Z")

</div>

Btw, I checked your tutorial again (I remember way back when you had it posted) and I am unclear about one thing: What and where is “section”. Its referenced in the code but I dont see any explaination of it in you tutorial.

Also I attached a zip file with my source .fla

Maybe you could see what I am doing wrong.

Thanks,  
Spesh

---

<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:** [November 16, 2003, 6:55pm UTC](https://forum.kirupa.com/t/preloader-problems/94726/4 "2003-11-16T18:55:13Z")

</div>

section is the variable that controls which swf will be loaded.
