Skip to main content
klinek3
Inspiring
August 6, 2010
Answered

How to check if text is loaded?

  • August 6, 2010
  • 1 reply
  • 528 views

Hello. I wonder if there is any way (in AS3) for checking whether the text is loaded into dynamic text field (from the external file).

Any ideas?

     Regards

This topic has been closed for replies.
Correct answer deepanjan_das

Hi,

Run an ENTER_FRAME Event and check the length of the textfield.

addEventListener( Event.ENTER_FRAME, checkText, false, 0, true );

private function checkText( event:Event ):void

{

     if(textField.text.length > 0){

          removeEventListener( Event.ENTER_FRAME, checkText );

          //textfield set

     }

}

Better will be using CHANGE Event for the TextField.

Hope this helps

Warm Regards

Deepanjan Das

http://deepanjandas.wordpress.com/

1 reply

deepanjan_das
deepanjan_dasCorrect answer
Inspiring
August 6, 2010

Hi,

Run an ENTER_FRAME Event and check the length of the textfield.

addEventListener( Event.ENTER_FRAME, checkText, false, 0, true );

private function checkText( event:Event ):void

{

     if(textField.text.length > 0){

          removeEventListener( Event.ENTER_FRAME, checkText );

          //textfield set

     }

}

Better will be using CHANGE Event for the TextField.

Hope this helps

Warm Regards

Deepanjan Das

http://deepanjandas.wordpress.com/

klinek3
klinek3Author
Inspiring
August 6, 2010

Thanks for the reply Deepanjan Das. This is exactly what I was looking for.

Works fine for me.

Regards