OK. I’m trying to make a dynamically scrolling text box. I put in the dynamic text box, set it to multiline. Then, I get my scrollbar component and drag it onto the dynamic text box; it locks in.
OK now it gets weird. I type in the actionscript from the macromedia.com tutorial (it’s very similar to the kirupa tutorial script, but even when I use the kirupa script it screws up):
loadVarsText = new loadVars();
loadVarsText.load(“test.txt”);
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace(“done loading”);
//Now that we know the data is loaded,
//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”);
}
};
This is supposed to have the text box display the text in text.txt, and I assigned the contents of the variable “var1” (the first line in the txt file is “var1=”)
Then I publish it, and I get THIS problem:
Warning Scene=Scene 1, layer=text, frame=1:Line 1: The identifier ‘loadVars’ will not resolve to built-in object ‘LoadVars’ at runtime.
loadVarsText = new loadVars();
Total ActionScript Errors: 1 Reported Errors: 1
The published swf is in the same folder as test.txt! The macromedia tutorial source file has the exact code and stuff, AND IT WORKS when published! I don’t know what’s going on. Someone help.
-fabbuki