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;
};