Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need help on LoadVars from a .txt file

Posted on 2006-06-22
2
Medium Priority
?
217 Views
Last Modified: 2010-04-03
I have this actionscript code:

main_txtbox.html=true;      

test="MyVars"

if (test == "MyVars" ) {
myData = new LoadVars();
myData.onLoad = function() {

//request variables from vars.txt
main_txtbox.htmlText = this.test + "_Text";

};
myData.load("vars.txt");
}


======================
in my vars.txt i have:

MyVars_Text= <b>blah</b> blah blah blah blah




Why isnt it working? why isnt it loading the text from vars.txt into the flash textbox?

But if i change this:

//request variables from vars.txt
main_txtbox.htmlText = this.test + "_Text";

to this:

//request variables from vars.txt
main_txtbox.htmlText = this.MyVars_Text;

it works!!!!????




0
Comment
Question by:Sam Cohen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 300 total points
ID: 16965877
hi there, try this:

main_txtbox.html=true;    
test="MyVars"
if (test == "MyVars" )
{
    myData = new LoadVars();
    myData.onLoad = function()
    {
       place = "this."+test+"_Text"
       main_txtbox.htmlText = eval(place)
    }
    myData.load("vars.txt");
}

Pay attention to Case Sensitive in Flash (It can drives you crazy lol)

Working here :)

Anything gimme a call
0
 
LVL 8

Author Comment

by:Sam Cohen
ID: 16966346
Thank U so Much can u answer another question of mine here:

http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21896612.html
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question