3 Replies Latest reply on Aug 10, 2013 4:03 AM by BornA

    getTextField() returns null

    scrubhead

      I am trting to access the textField of a textArea using the mx_internal method getTextField. I use the ADDED_TO_STAGE event to wait for the textarea to be available and use TextArea.mx_internal::getTextField() method, but that reurns null? What am I doing wrong?

       

      var newText = new TextArea();
      newtext.width = 40;

      newtext.height = 50;

      newtext.htmlText = "text"

       

      newtext.addEventListener(Event.ADDED_TO_STAGE, tfadded)

      addChild(newtext)

       

      function tfadded(e){

       

      var tf:TextField = newtext.getTextField()

      as TextField;

       

      Alert.show(getQualifiedClassName(tf)) // returns null

       

      }