Solved

Need help on LoadVars from a .txt file

Posted on 2006-06-22
2
208 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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.

718 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