When using an mx:Canvas from the Flex api inside a Sprite, I’m getting a TypeError: Error #1009 and following stack:
> StyleManager/getStyleManager
> StyleProtoChain/getStyleManager
> StyleProtoChain/initProtoChain
> UIComponent/initProtoChain
> UIComponent/regenerateStyleCache
> Container/regenerateStyleCache
I guess this is because it require extra initialisation that is usually operated by or from Application / parent contaienr.
Has anybody successfully experienced such wrapping, or, is there any alternative to mx:Canvas in Flash/AS3 ?
If it is not possible, I’ll go for a specific actionscript class, or for a stylished Mx application.
You cannot use Flex UI components inside pure Flash application. You cannot put Flex component inside Sprite: read about its lifecycles, there’s many things that Convas wants to see in it’s parent.
The only solution I see is to have Flex application with mixed content (Flash and Flex), with condition that Flex components are not situated inside Sprites.
The alternative to Canvas in Flash is Sprite (ta-da!). The biggest difference is in its size calculation and external setting (e.g. How to calculate the size of a sprite?).