Skip navigation
mreid2005
Currently Being Moderated

my_data.load() not accepting variable input

Jun 29, 2012 2:05 AM

Tags: #as2 #actionscript #2.0 #flashvars

I'm trying to assign the textfile to load through a variable instead of hardcoded.  and I'm not sure what I'm missing.

 

understand I basically created a test harness in order to test the concept, I have the data loading from a flashvar normally.

 

 

text1.text = "michael080900.txt";

text3.text = '"' + text1.text + '"';

 

if I put "michael080900.txt" in the my_data.load() the code works perfectly. everything I want to happen does.

 

however, I'm not sure what I'm missing when I attempt to load it through a variable.  any insight would be truly appreciated.

 

my_data.load(text3.text);

 
Replies
  • Currently Being Moderated
    Jun 29, 2012 4:18 AM   in reply to mreid2005

    Is what you are calling a variable actually a textfield?  If so, you should make sure that it (they) is set to be a single line textfield rather than multiline.  Also, text3.text = text1.text should be sufficient, no need for the extra quotes.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 5:01 AM   in reply to mreid2005

    You're welcome.  Your use of  "anything.text" would indicate you are trying to use a textfield and not a variable, which is why I asked.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points