1 Reply Latest reply on Sep 10, 2009 10:03 AM by kglad

    Can't access TextInput's text from inside the parent class

    Paulo Ricca Level 1

      Hi

      i have a really strange problem here:

      When I add a TextInput to the stage I can access it with instanceName.text. this works.

      Now I have one Movieclip with one TextInput inside (the textinput's instance name is testetxt). This MovieClip has a corresponding class and its code is the following:

       

      class com.sck.testeT extends MovieClip

      {

           public var testetxt:MovieClip;

           public function testeT()

           {

                testetxt._alpha=50;

                testetxt.text="test";

           }

      }                    

       

      The textinput gets transparent but the text isn't changed... I realized it was because the textinput wasn't initialized yet. so I have to wait a while, but how can I know that it was initialized and I can set the initial text by code?

      thanks a lot!