7 Replies Latest reply on Jun 19, 2006 6:19 PM by kglad

    Loading Text problem

    sbryner Level 1
      Hello,

      I'm trying to load my text variables (aBox, and rBox) from a file called rv.txt into two dynamic text fields aBox and rBox. this file is an external .swf file loaded into my main .swf.

      I can get the variables to load into myVars and trace it with the correct output text.

      The problem is when I call it to the dynamic text box:

      aBox_txt.text = myLV.aBox;

      it doesn't seem to work. It appears in my trace box with the right text but not in my dynamic text box.
      I can't seem to figure it out.

      The text is white because the main .swf bg is black. my rv.swf appears when
      it's suppose to in my main.swf just without the text loaded. other static text boxes appear.
      I've embed: my font

      what could I be doing wrong?

      Please help,

      thanks,

      sky
        • 1. Re: Loading Text problem
          kglad Adobe Community Professional & MVP
          you could be assign aBox_txt's text property before myLV.aBox is defined. are you using an onLoad handler to ensure the data (rv.txt) are loaded?
          • 2. Re: Loading Text problem
            nilu_only Level 1
            this sample code loding txt file variables in flash
            xyz and topic are txt field variables in flash
            this works
            abc.load( "abc.txt");
            abc.onLoad = function(success) {
            xyz = abc.data;
            topic = abc.pqr;
            }
            • 3. Re: Loading Text problem
              sbryner Level 1
              Here is my code: I think it looks the same

              var myLV:LoadVars = new LoadVars();
              myLV.load("rv.txt");


              myLV.onLoad = function(success) {
              if (success) {

              aBox_txt.text = myLV.aBox;
              rBox_txt.text = myLV.rBox;

              trace(myLV.aBox);
              trace(myLV.rBox);
              }
              };

              can anyone see what I'm doing wrong?
              • 4. Re: Loading Text problem
                kglad Adobe Community Professional & MVP
                if your trace statement is correct, your path/instance name to aBox_txt and rBox_txt are incorrect or you are assigning the text property correct but can't see it because of, at least, one issue. the most common would be a need to embed your font.

                to help resolve, use trace(aBox_txt) within your onLoad handler to see if your path/instance name is correct.
                • 5. Re: Loading Text problem
                  sbryner Level 1




                  When I use trace(aBox_txt);

                  I get a _level10.aBox_txt message.
                  I have embedded my fonts.

                  I can use trace to get the text in my aBox_txt to appear in the message box

                  and I can use trace to get the text from my .txt file to appear in the message window as well. I, for the life of me just can not get it to appear in the dynamic txt box, aBox_txt.text

                  any other thoughts?


                  var myLV:LoadVars = new LoadVars();
                  myLV.load("rv.txt");


                  myLV.onLoad = function(success) {
                  if (success) {

                  aBox_txt.text = myLV.aBox;
                  rBox_txt.text = myLV.rBox;

                  //trace(myLV.aBox);
                  //trace(myLV.rBox);
                  trace(aBox_txt); //returns
                  _level10.aBox_txt
                  }
                  };
                  • 6. Re: Loading Text problem
                    sbryner Level 1
                    It's an embed fonts problem!

                    How can I fix it. I select the text fields click the embed button select the 4 main items :punctuation, lowercase, uppercase and numerals.
                    then click "ok".

                    well, the text only flashes if I do that and the text field is set to "Anti-alias for readability". Though,it appears constantly if it's on "use device fonts".

                    please help,

                    sky
                    • 7. Re: Loading Text problem
                      kglad Adobe Community Professional & MVP
                      post a link to your fla and specify the location of your code.