# Preloader for external files in mc

**URL:** <https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622>\
**Category:** Uncategorized\
**Created:** [August 28, 2003, 7:23pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622 "2003-08-28T19:23:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shallroc](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shallroc](https://forum.kirupa.com/u/shallroc)\
**Post date:** [August 28, 2003, 7:23pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/1 "2003-08-28T19:23:32Z")

</div>

I have a movie which has 10 buttons each button loads in an external swf into a container onRelease.

The swf files have a preloader already built in but only works properly offline.

Online it seems to miscalculate the file size of itself and only loads part of itself in.

on second click of button the swf files load in fine…

Any suggestions would be a great help.

This has been wrecking me for 24 hours now…

.[http://www.kirupaforum.com/forums/newthread.php?s=&action=newthread&forumid=7#](http://www.kirupaforum.com/forums/newthread.php?s=&action=newthread&forumid=7#)

---

<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:** [August 28, 2003, 7:28pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/2 "2003-08-28T19:28:34Z")

</div>

this is the preloader code which is in the external swf files. taken from Flash mx Bible.

lBytes = \_root.getBytesLoaded();  
tBytes = \_root.getBytesTotal();  
percentLoaded = Math.floor((lBytes/tBytes)\*100);  
loader.bar.\_xscale = percentLoaded;  
loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + “K loaded.”;  
if (lBytes\>=tBytes && tBytes\>0) {  
if (count\>=12) {  
gotoAndStop(“main”);  
} else {  
count++;  
gotoAndPlay(“preload”);  
}  
} else {  
gotoAndPlay(“preload”);  
}

---

<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:** [August 28, 2003, 7:36pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/3 "2003-08-28T19:36:13Z")

</div>

You’re using \_root in external swfs as preloader ? No good. Use lost’s preloader, [here](http://www.kirupa.com/developer/mx/percentagepreloader.htm).

---

<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:** [August 28, 2003, 7:44pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/4 "2003-08-28T19:44:13Z")

</div>

i am using losts preloader on this project and it works great.

[www.mdipi.com/sorry/mainPage.html](http://www.mdipi.com/sorry/mainPage.html) (second link)

---

<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:** [August 28, 2003, 8:03pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/5 "2003-08-28T20:03:36Z")

</div>

guys this sounds good to me…

Gonna eat my beans on toast(With cheeese).been up for 24 hrs on this \*\*\*\*\*…

And then check it out…

But sounds good to me…

Cheers \*\_^

Speak in a mo

---

<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:** [August 28, 2003, 8:19pm UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/6 "2003-08-28T20:19:25Z")

</div>

sorry guys my brain has crashed…  
Eyes on stalks at the mo…

Gonna start a fresh with the losts code tommorrow…

Will keep you posted…

Thanxs again for all the help…

Shallroc \*\_^

---

<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:** [August 29, 2003, 9:17am UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/7 "2003-08-29T09:17:18Z")

</div>

Well got up this morning, nice strong coffee and went through the lost preloader.

One thing WICKED…

Works a brilliantly my headache has now gone, Bosssssss

Thanxs Voetsjoeba and Gigli much respect

---

<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:** [August 29, 2003, 9:18am UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/8 "2003-08-29T09:18:54Z")

</div>

Thank lostinbeta 😉

---

<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:** [August 29, 2003, 9:22am UTC](https://forum.kirupa.com/t/preloader-for-external-files-in-mc/29622/9 "2003-08-29T09:22:43Z")

</div>

Thank lostinbeta indeed. respect all round
