# Preloader for SWF loaded into SWF

**URL:** <https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721>\
**Category:** Uncategorized\
**Created:** [March 1, 2003, 10:58pm UTC](https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721 "2003-03-01T22:58:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![russsty1](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@russsty1](https://forum.kirupa.com/u/russsty1)\
**Post date:** [March 1, 2003, 10:58pm UTC](https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721/1 "2003-03-01T22:58:29Z")

</div>

Hi All,

Can you tell me the solution to getting progress bars to work in on an SWF that is coded to load into your main SWF movie that sits on the web?

My progress bar just sits on 100% and indicates no progress at all?

Where do I change the code from a normal bar?

Hope you can help:  
rusty\_:q:

---

<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:** [March 1, 2003, 11:24pm UTC](https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721/2 "2003-03-01T23:24:22Z")

</div>

try changing everywhere that it says “\_root” to “\_parent” that might work…

---

<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:** [March 2, 2003, 12:06am UTC](https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721/3 "2003-03-02T00:06:41Z")

</div>

Thanks, I have put this code onto frame 1 of the SWF I am loading into the ‘targetClip’ that sits on my mainSWF, and have tested online but the 100% bar is just sticking on 100% untill the movie loads!

this.onLoad = function(){  
myWidth = myBar.\_width /100;  
myBar.\_width = 0;  
}  
this.onEnterFrame = function() {  
total\_bytes = Math.round(\_parent.getBytesTotal()/1000);  
loaded\_bytes = Math.round(\_parent.getBytesLoaded()/1000);  
remaining\_bytes = total\_bytes-loaded\_bytes;  
percent\_done = Math.round(\_parent.getBytesLoaded()/\_parent.getBytesTotal()\*100);  
displaypercent = percent\_done +" %";  
myBar.\_width = 1.7 \* percent\_done;  
trace(myWidth);  
bar.gotoAndStop(percent\_done);  
ifFrameLoaded (“Scene 2”, 7) {  
gotoAndStop (“Scene 2”, 1);  
}  
}

any further ideas?  
ta\_  
russsty\_

---

<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:** [March 2, 2003, 10:28am UTC](https://forum.kirupa.com/t/preloader-for-swf-loaded-into-swf/14721/4 "2003-03-02T10:28:56Z")

</div>

**this** or **\_level#.targetClipInstanceName** should work 🙂
