# Preload dynamic text

**URL:** <https://forum.kirupa.com/t/preload-dynamic-text/179918>\
**Category:** Uncategorized\
**Created:** [February 23, 2006, 11:28pm UTC](https://forum.kirupa.com/t/preload-dynamic-text/179918 "2006-02-23T23:28:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aBnest](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/abnest/32/2177_2.png) [@aBnest](https://forum.kirupa.com/u/aBnest)\
**Post date:** [February 23, 2006, 11:28pm UTC](https://forum.kirupa.com/t/preload-dynamic-text/179918/1 "2006-02-23T23:28:33Z")

</div>

hello, i’m trying to load dynamic text with a preloader !my problem is that i can’t figure out how to create by script a dynamic txt box in the movieclipLoader

this is what i tryed to do:  
// i have a lorem.txt in my root folder witch contains the txtField variable name’

can anyone tell me where to start … i’m lost

obviosly my output for the my\_txt variable is “undefined”

MovieClip.prototype.fadeIn = function() {  
this.onEnterFrame = function() {  
if (this.\_alpha\<100) {  
this.\_alpha += 10;  
} else {  
delete this.onEnterFrame;  
}  
};  
};  
bar.\_visible = false;  
border.\_visible = false;  
var empty = this.createEmptyMovieClip(“container”, “100”);  
empty.\_x = 0;  
empty.\_y = 0;  
my\_mc = new MovieClipLoader();  
my\_mc.createTextField(“my\_txt”, 1, 200, 90, 300, 100);  
my\_txt.type=“dynamic”;  
my\_txt.multiline = true;  
my\_txt.wordWrap = true;  
var my\_fmt:TextFormat = new TextFormat();  
my\_fmt.color = 0xFFFFFF;  
my\_fmt.underline = false;  
trace(my\_txt);  
preload = new Object();  
my\_mc.addListener(preload);  
preload.onLoadStart = function(targetMC) {  
trace("started loading "+targetMC);  
container.\_alpha = 0;  
bar.\_visible = true;  
border.\_visible = true;  
pText.\_visible = true;  
};  
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {  
bar.\_width = (lBytes/tBytes)\*100;  
pText.text = “% “+Math.round((lBytes/tBytes)\*100);  
};  
preload.onLoadComplete = function(targetMC) {  
container.fadeIn();  
border.\_visible = false;  
bar.\_visible = false;  
dText.\_visible = false;  
trace(targetMC+” finished”);  
};

my\_mc.my\_txt.loadText = new LoadVars();  
my\_mc.my\_txt.loadText.load(“lorem.txt”);  
my\_mc.my\_txt.loadText.onLoad = function() {  
my\_txt.text = this.txtField;  
};
