# Preload external swf

**URL:** https://forum.kirupa.com/t/preload-external-swf/214396
**Category:** Uncategorized
**Created:** [January 28, 2007, 5:13pm UTC](https://forum.kirupa.com/t/preload-external-swf/214396 "2007-01-28T17:13:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hmmaah](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hmmaah](https://forum.kirupa.com/u/hmmaah)
#### Post date: [January 28, 2007, 5:13pm UTC](https://forum.kirupa.com/t/preload-external-swf/214396/1 "2007-01-28T17:13:31Z")

</div>

Hi - quick question. Is there any reason why the code below would stop working if it is used in an externally loaded swf? Something to do with the “\_root” maybe… but I’m not sure how to go forward.

Any hints?  
Many thanks.

* * *

bytes\_loaded = Math.round(\_root.getBytesLoaded());  
bytes\_total = Math.round(\_root.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
\_root.loadBar.\_width = getPercent_100;  
\_root.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
\_root.gotoAndStop(3);  
}
