Thursday, April 19, 2012

s:SpriteVisualElement and "component declarations are not allowed here"

Take a look at the following code.



<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:view="client.view.*" minWidth="955" minHeight="600">
<s:Panel x="10" y="10" height="100%" title="CTW" borderColor="#008040" fontFamily="Arial" fontWeight="bold" fontSize="13">
<s:HGroup>
...
<s:Scroller id="canvasGroup" width="650" height="500">
<s:Group>
<s:SpriteVisualElement>
<view:PNGCanvas id="canvas" /> <!-- error is thrown here -->
</s:SpriteVisualElement>
</s:Group>
</s:Scroller>
</s:HGroup>
</s:Panel>
</s:Application>


PNGCanvas extends flash.display.Sprite. I'm getting an error component declarations are not allowed here (on line marked with error is thrown here). What's wrong here?



Thank you in advance!!!





No comments:

Post a Comment