# Preload external .txt?

**URL:** <https://forum.kirupa.com/t/preload-external-txt/192231>\
**Category:** flash\
**Created:** [June 27, 2006, 5:22am UTC](https://forum.kirupa.com/t/preload-external-txt/192231 "2006-06-27T05:22:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennings112](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jennings112](https://forum.kirupa.com/u/jennings112)\
**Post date:** [June 27, 2006, 5:22am UTC](https://forum.kirupa.com/t/preload-external-txt/192231/1 "2006-06-27T05:22:33Z")

</div>

Hey,

Does anyone know how to preload external .txt files with the main swf preloader?

Here is my preloader code:

> 

[COLOR=SeaGreen]onClipEvent(load) {  
// start the width of the load bar to be 0  
this.\_xscale = 0;  
}  
onClipEvent(enterFrame) {  
// Find how many bytes of this movieClip have loaded  
// using \_parent assumes this code is on a movieClip  
// at the \_root of the swf being loaded  
loadedBytes = \_parent.getBytesLoaded();  
// Get the total bytes of the movieClip  
totalBytes = \_parent.getBytesTotal();  
// determine the percentage of bytes that have loaded  
percentDone = Math.round((loadedBytes / totalBytes) \* 100);  
// display the percentage of loaded bytes in the text field loadStatus  
\_parent.loadStatus = percentDone + “%”;  
// set the size of our loadBar clip to the percent of loaded bytes  
this.\_xscale = percentDone;  
// move the loader movieClip to the appropriate frame  
\_parent.loader\_mc.gotoAndStop(percentDone);  
// if all the bytes have finished loading…  
if (loadedBytes == totalBytes) {  
// …play the rest of the movie  
\_parent.gotoAndPlay(“Start”);  
}  
}[/COLOR]
