Sunday, May 23, 2010

Error #1046: Type was not found or was not a compile-time constant: TextField.

Environment:
Flash, Action Script 3 



Scenario:
publishing FLA and getting the error "Error #1046: Type was not found or was not a compile-time constant: TextField"


Problem:
You have not imported everything you are including in your movieClip. For example if you are using dynamic textField inside your movieClip and you didn't imported the TextFiled class
Even if you create a dynamic text field and yet you didn't create the code to handle this dynamic text field you'll see this error.




Solution:
Import the the relevant class.
In this case:
import flash.text.TextField;