Payday Loans Online Payday Loans Online

Todd Rothe : UI/UX Developer

it's pronounced rowth-ee

By 2g1c2 girls 1 cup

AS3 Error 1064: Type was not found or was not a compile-time constant

1046: Type was not found or was not a compile-time constant: SymbolX

This error is most commonly received when you do not import a certain class but proceed to instantiate it. If you tell AS3 to create an instance of TextArea but do not import the class ( import flash.display.TextArea; ) then you will see error 1046: Type was not found or was not a compile-time constant: TextArea.

The less common reason, and the one I ran into this week, goes like this.
You have a symbol in the library, let’s call it symbol1, and in its linkage properties it has a class name of ‘mySymbol’. Then you place an instance of symbol1 on the stage and give it an instance name of ‘mySymbol’.
The result is
1046: Type was not found or was not a compile-time constant: mySymbol.

On the livedocs compiler errors page the first line in description of Error 1064 eludes to the reason this occurs but it goes on to discuss other things.

‘The class used as a type declaration is either unknown or is an expression that could have different values at run time. ‘

In the example above the ‘mySymbol’ could have different values at runtime. It could be interpreted as a class or as a stage instance.

Thanks to the ‘best practice’ of class names starting with uppercase letters and instances starting with lowercase letters this situation is not a common one.

 

No Responses to “AS3 Error 1064: Type was not found or was not a compile-time constant” (post new)

 

Leave a Reply

You must be logged in to post a comment.