3 Replies Latest reply on Jul 1, 2012 5:01 AM by Ned Murphy

    my_data.load() not accepting variable input

    mreid2005

      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);

        • 1. Re: my_data.load() not accepting variable input
          Ned Murphy Adobe Community Professional & MVP

          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.

          • 2. Re: my_data.load() not accepting variable input
            mreid2005 Level 1

            Ned,

             

            Thanks for the reply, it led me to the answer.

             

            I had a piece of example code that I followed that had this line in it.

             

            my_data.load("textfile.txt")

             

            which led me to believe that if I wanted to load a textfile that was dynamically named and generated externally, that I needed to provide that name through a variable, and would need the quotes.

             

            <param name=FlashVars value="myVariable=Michael011852.txt&mySecondVariable=0.30000" />

             

            so I was attempting to add "quotes" around my flashvar data , but, that is what I get for thinking.

            Apparently all I had to do the whole time was this in order to get it to work.

             

            my_data.load(myVariable)

             

            go figure. doh!

            • 3. Re: my_data.load() not accepting variable input
              Ned Murphy Adobe Community Professional & MVP

              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.