If I make an ActionScript Project - things work fine. I link the SWC, import the asset's stub class & I can use it. However I can't figure how to do the same for a Flex Project or Flex Mobile Project yet.
Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.net On Wed, Sep 21, 2011 at 10:51 AM, Eric E. Dolecki <edole...@gmail.com>wrote: > *implicit coercion of a value of type mx.core.IVisualElement to unrelated > type Sphere.* > :/ > > > 2011/9/21 Cédric Muller <flashco...@benga.li> > >> 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 <Flashcoders@chattyfig.figleaf.com> >>> http://chattyfig.figleaf.com/**mailman/listinfo/flashcoders<http://chattyfig.figleaf.com/mailman/listinfo/flashcoders> >>> >> >> ______________________________**_________________ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.**com <Flashcoders@chattyfig.figleaf.com> >> http://chattyfig.figleaf.com/**mailman/listinfo/flashcoders<http://chattyfig.figleaf.com/mailman/listinfo/flashcoders> >> > > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders