Problem with Dynamic Text

Hello to all, I’m a new user who just stumbled onto the site when i searched for anyone other than Macromedia to help me with flash. here’s my problem;

I’m trying to load dynamic text into a textbox named intbox

with this code, which I grabbed from this site and modified slightly for my use

loadText = new loadVars();
loadText.load(“intro.txt”);
//creating the loadVarsText function
loadText.onLoad = function() {
intbox.text = this.introtext;
};

but I keep getting this message;

Warning Scene=Scene 1 fade, layer=dynamic text, frame=1:Line 1: The identifier ‘loadVars’ will not resolve to built-in object ‘LoadVars’ at runtime.
loadText = new loadVars();
Total ActionScript Errors: 1 Reported Errors: 1

can anyone possibly tell me why?

thanks in advance,

Sim

Try this tutorial.
http://www.kirupa.com/developer/mx/multiple_dynamictext.htm

Is the code you are using on a button?

No, its not on a button, its just supposed to load the text when the flash animation runs.

—> So after i read the error message a few times I decided to change the lowercase l on loadVar to LoadVar and voila, it worked, thanks for the help anyways .

Sim

You create a dynamic text box and enter “intBox” (in your example) in the VAR field in the property inspector. I think your problem is that you’re entering it into the “<Instance name>”.

If this doesn’t fix it then there’s a problem with importing the textfile.

It’s because you’re using loadVars instead of LoadVars :wink: Flash MX 2004 is case sensitive, unlike FMX.