Skip to main content
Known Participant
June 17, 2006
Answered

LoadVars

this is driving me mad. i am using flash mx 2004 (on mac)
I have the text file named "news.txt" in the same folder and my published swf file, but it will not load it, it just gives me a blank text box.

in the text file i assigned the text: info=this is my text.

and the dynamic text field is named "myText"

i have an intro, so the text field doesnt show up until the 60th frame, which is where i placed the actionscript - does this matter?

here is my code:

var myLV:LoadVars = new LoadVars();

myLV.onLoad = function(success) {
if (success) {
myText.htmlText = myLV.info;
} else {
myText.text = "There was an error when loading the external file.";
}
};

myLV.load("news.txt");
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
June 18, 2006
no bug. are you doing something that requires your textfield's font to be embedded? for example, is your textfield masked?

8 replies

kglad
Community Expert
Community Expert
June 18, 2006
you're welcome.
Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 18, 2006
no bug. are you doing something that requires your textfield's font to be embedded? for example, is your textfield masked?
Translate
hushhurtAuthor
Known Participant
June 18, 2006
oh man... i feel silly.

i created an outline box over my text box will a fill, once i erased that, low and behold there was my text - thanks for all the help.

i will go stand in the corner now.
Translate
kglad
Community Expert
Community Expert
June 17, 2006
what do you see in the output panel if you replace your code on the 60th frame with:
Translate
hushhurtAuthor
Known Participant
June 18, 2006
i get this in the output panel:

_level0.myText :: this is test text information for the loadvars function.

which "this is test text information for the loadvars function." is what i typed in my text file, but it still does not display in the text field.

any ideas?
Translate
Participating Frequently
June 18, 2006
When you mean when you name your dynamic text field "myText". Because if that's the variable name it won't work. I hope you've used that as the instance name of the textfield.
Translate