MX-Load html txt file to main stage

Hello,

I have the ActionScript working fine on the main stage. Once I convert all layers into mc_clip, then put the mc_clip into the main stage, my html txt file no longer appear on the scroll area. Below is the ActionScript on the first frame in mc_clip. Also, the button 1 and button2 ActionScript to display the html.

Questions:
How to call the html to display on the main stage?

This is the ActionScript in mc_clip:
//load html txt file
loadVariablesNum(“davehtml.txt”, 0);
loadVariablesNum(“greghtml.txt”, 0);
// Create a new instance of the loadVars object and assing it to a variable
loadVarsText = new loadVars();
loadVarsText.load(“loadDaveText.txt”);
// assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
// set the text content of the Text Field
// with the instance name “scroller” equal to the
// contents of the variable
scroller.text = this.var1;
} else {
trace(“not loaded”);
}
};

ActionScript on button:
//Click button1 to display davehtml text file in the scroll area
on (release) {
display = HTMLpageDave;
}
//Click button2 to display greghtml text file in the scroll area
on (release) {
display = HTMLpageGreg;
}

I am new in this forum. I hope I can find my answers here.
Thank you in advance!!

:q:

//load html txt file
loadVariablesNum("davehtml.txt", 0);
loadVariablesNum("greghtml.txt", 0);
// Create a new instance of the loadVars object and assing it to a variable
loadVarsText = new loadVars();
loadVarsText.load("loadDaveText.txt");
// assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
// set the text content of the Text Field
// with the instance name "scroller" equal to the
// contents of the variable
<B>scroller.html = true;
scroller.htmlText = this.var1;</B>
} else {
trace("not loaded");
}
};

Please note that I added an html = true and change .text to .htmlText, this html enables your text box.

You can only use text formatting html tags though. Things like bold, italics, underlined, font color, font size, links, etc.

Why are you using loadVariablesNum when you can use LoadVars?

lostinbeta,

It works. I have the button on the main stage to call that movie in the 2nd Scene which contains the code below. I figure out the problem is the level. On the main stage, the button to call the 2nd scene movie should have level 20 and the 2nd scene movie should have level 0.

Either scroller.text = this.var1; or scroller.html = true;
scroller.htmlText = this.var1; works in the script.

Thanks!!

h88,

I was using loadVariablesNum to load the file to level 0 first.

Thanks.