# Preloading external text

**URL:** <https://forum.kirupa.com/t/preloading-external-text/69007>\
**Category:** flash\
**Created:** [October 31, 2004, 10:27am UTC](https://forum.kirupa.com/t/preloading-external-text/69007 "2004-10-31T10:27:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archimago](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@Archimago](https://forum.kirupa.com/u/Archimago)\
**Post date:** [October 31, 2004, 10:27am UTC](https://forum.kirupa.com/t/preloading-external-text/69007/1 "2004-10-31T10:27:52Z")

</div>

I have a problem on how to preload external text in my preloader.

I have the following code on frame 1, this preloads the entire swf, but not the textfile which is loaded on another frame:

path = “IMA\_Services/”;  
bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loaderbartext = Math.round(getPercent_100)+"%";  
if (bytes\_loaded \<= bytes\_total/2) {  
this.loaderbar.\_width = 750_getPercent_2;  
this.loaderbar.\_x = 5;  
} else if (bytes\_loaded \> bytes\_total/2) {  
this.loaderbar.\_width = 1500-(1500_(getPercent));  
this.loaderbar.\_x = 5+(1500\*(getPercent))-750;  
};  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

On Frame 2 I have the usual :  
gotoAndPlay(1);

On frame 8 I have the textloaders and on that frame the texfields appear in the movie with a fade over a couple of frames, trouble is if text is to long I do not see the text fading but \_level0.projectcontainer.textfield1:

loadText1 = new loadVars();  
loadText2 = new loadVars();  
loadText1.load(path+“Services\_Arc\_1\_0.txt”);  
loadText2.load(path+“Services\_Arc\_1\_1.txt”);  
loadText1.onLoad = function(success) {  
if (success) {  
textfield0.html = false;  
textfield0.Text = this.textfield0;  
}  
}  
loadText2.onLoad = function(success) {  
if (success) {  
textfield1.html = true;  
textfield1.htmlText = this.textfield1;  
}  
}

var ipos = 1;

Can someone help me integrating the textload in the preloader ?

Any help is welcome, I am trying mysself but have had no success yet.

Christophe
