Solved

Need help on LoadVars from a .txt file

Posted on 2006-06-22
2
190 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
2 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 75 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

816 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now