# Preloading external .swf

**URL:** https://forum.kirupa.com/t/preloading-external-swf/162321
**Category:** Uncategorized
**Created:** [September 12, 2005, 7:06am UTC](https://forum.kirupa.com/t/preloading-external-swf/162321 "2005-09-12T07:06:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oracle101](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@oracle101](https://forum.kirupa.com/u/oracle101)
#### Post date: [September 12, 2005, 7:06am UTC](https://forum.kirupa.com/t/preloading-external-swf/162321/1 "2005-09-12T07:06:57Z")

</div>

Hi guys & gals,

I have a preloader that i found on the net which i am using to load my main .swf

Inside the main .swf I am loading several external .swf’s and I wanted to use the same preloader to load them in… however I am having a bit of trouble doing so…

here is the code that is attached to the preloader I am using…  
Code:  
[left] onClipEvent (load) { total = \_root.getBytesTotal();}onClipEvent (enterFrame) { loaded = \_root.getBytesLoaded(); percent = int(loaded/total\*100); text = " “+percent+”%"; gotoAndStop(percent); if (loaded == total) { \_root.gotoAndPlay(2); }}[/left]

When i use this preloader inside an external .swf which I am pulling into my main movie it resets the whole movie back to the begining… i guess because of the referals to \_root in the code…

Can someone please tell me how I should modify this code for the preloaders in my external .swf’s so I can preload and then play my exyternal .swf’s in my main movie.

Many many thanks in advance…

Regards,  
Mik
