all groups > flash actionscript > october 2004 >
You're in the

flash actionscript

group:

Problems with TXT to dynamic Text


Problems with TXT to dynamic Text jthereliable
10/12/2004 9:40:10 PM
flash actionscript: My question is that if it is possible to load a .txt file and put only it's
contents inside a dynamic text.
A member called _jrh_ told me this code:
//text file
name=something&pass=nothing

// to load the text
myLV = new LoadVars();
myLV.onLoad = function(success) {
if (success) {
trace(myLV.name); // outputs "something"
trace(myLV.pass); // outputs "nothing"
} else {
trace("load failed");
}
}
myLV.load("test.txt");

When I tried it, It gave me this error:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: Left side of
assignment operator must be variable or property.
name=something&pass=nothing

Total ActionScript Errors: 1 Reported Errors: 1


When I took a small look in the Actionscript Guide of Flash, the dynamic text
displayed this:
Hello=&onLoad=%5Btype%20Function%5D

I don't want anything past the Hello, what do i do?

Also, when i put a "!" or stuff, it comes out in a wierd thing like %21 and
stuff...

Thanks in advance!
Re: Problems with TXT to dynamic Text _jrh_
10/12/2004 9:52:24 PM
Perhaps I was unclear. Where I have:

// text file
name=something&pass=nothing

I meant for you to put that content in your text file called "test.txt" in the
same directory as your fla. Sorry for the confusion.
Re: Problems with TXT to dynamic Text jthereliable
10/12/2004 10:38:20 PM
Re: Problems with TXT to dynamic Text _jrh_
10/12/2004 10:41:34 PM
AddThis Social Bookmark Button