what if you do 'var s:Sphere = new Sphere() as IVisualElement' ?`
Apologies but I haven't done any Flex in a few years and I am
getting back
into it.
I created a FLA and then created some visual assets in the Library,
with
Linkage names. I then published a SWC of these.
In my Flex app project I linked the SWC with my project. Then I try
to call
the stuff up and place & I get an error:
<fx:Script>
<![CDATA[
private function init():void {
var s:Sphere = new Sphere();
this.addElement(s);
}
]]>
</fx:Script>
TypeError: Error #1034: Type Coercion failed: cannot convert
Sphere@46b0179to mx.core.IVisualElement.
?
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders