?
Solved

Need help on LoadVars from a .txt file

Posted on 2006-06-22
2
Medium Priority
?
211 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

800 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