3 Replies Latest reply: Jan 2, 2012 11:34 PM by DeBoo.Fr RSS

    trace function output to text field?

    Opaque17
      How do you send the output of a function to a dynamic text field on the stage instead of the output panel?

      I have used trace(); but that just sends the value to the output panel.

      Any help would be greatly appreciated.

      Best Regards.
        • 1. Re: trace function output to text field?
          derobinson Community Member
          try:

          instanceNameOfDynamicTextField.text = "this is my trace statement";

          good luck!
          • 2. Re: trace function output to text field?
            DeBoo.Fr

            I am also having this problem. My text box has a text property of 'DYNAMIC' and when I assign the instancename.text to a given text value, the box on the stage doesn't show that text. Instead, the text box just appears blank and the text only appears in the output panel.

             

            This is the code I am using is here (where text_base is the instance name of the-

             

            text_base.text = "Georgie Porgie blah blah blah"

            remix_btn.addEventListener(MouseEvent.CLICK, remixRhyme);

             

             

            function remixRhyme(event:MouseEvent):void{

                      var rhymeCopy:Array = new Array(rhyme.length);

              var randomPos:Number = 0;

             

                      rhymeCopy = rhyme.slice();

                      text_base.text = "";

             

                      for (var i:int = 0; i < rhyme.length; i++){

                                     randomPos = int(Math.random() * rhymeCopy.length);

                   text_base.text = text_base.text.concat(" ",rhymeCopy[randomPos]);    

                                     rhymeCopy.splice(randomPos, 1);

              }

            trace(text_base.text)

            }

            • 3. Re: trace function output to text field?
              DeBoo.Fr Community Member

              Ignore the above... I've discovered the problem and it was something really stupid . The code was fine!