Archive for January, 2009
Event type ‘com.flexcapacitor.events:StateHandler’ is unavailable.
Event type 'com.flexcapacitor.events:StateHandler' is unavailable.
Here is the line causing the error:
-
<managers:StateHandler state="{productsState1}" callFunction="Alert.show(ObjectUtil.toString(event))"/>
If I remove the callFunction attribute the error goes away. So what's the issue?
In my StateHandler class I have this metadata:
[Event(name="callFunction", type="com.flexcapacitor.events.StateHandler")]
The problem is the class is defined as StateHandlerEvent not StateHandler. So I change it StateHandlerEvent and it works:
[Event(name="callFunction", type="com.flexcapacitor.events.StateHandlerEvent")]
From the documentation
If you do not identify an event with the [Event] metadata tag, the compiler generates an error if you try to use the event name in MXML. The metadata for events is inherited from the superclass, however, so you do not need to tag events that are already defined with the [Event] metadata tag in the superclass.
No comments1046: Type was not found or was not a compile-time constant: ContentElement. TextLayoutFramework
Error Message
1046: Type was not found or was not a compile-time constant: ContentElement. TextLayoutFramework
[etc] ElementFormat. FontMetrics. TextElement. TextLine. Vector.
Cause
In this case the class was not found because I was specifying Flash Player 9 when the class was in Flash Player 10.
Solution
When I went into the Project Properties > Flex Compiler and changed the required version to 10.0.0 the errors went away.
Please note this is a case post. There are additional posts on this error.
2 comments