# Percentage loading with external file

**URL:** <https://forum.kirupa.com/t/percentage-loading-with-external-file/98710>\
**Category:** Uncategorized\
**Created:** [January 10, 2004, 1:44am UTC](https://forum.kirupa.com/t/percentage-loading-with-external-file/98710 "2004-01-10T01:44:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamer](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@dreamer](https://forum.kirupa.com/u/dreamer)\
**Post date:** [January 10, 2004, 1:44am UTC](https://forum.kirupa.com/t/percentage-loading-with-external-file/98710/1 "2004-01-10T01:44:09Z")

</div>

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

i am using this. However instead of getting the bytes loaded for the file this code is in. how do you make it get the bytes load of an external file? eg. externam file will be called page.swf

would be be like this?  
bytes\_loaded = Math.round(this.page.getBytesLoaded());  
bytes\_total = Math.round(this.page…getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loading = Math.round(getPercent\*100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}
