I'm trying to import a swf symbol into Flex 2. However, the following code
works great in AS3 project, but NOT in an MXML project:

       [Embed(source="../Art.swf", symbol="car_blue")]
       private var CarBlue:Class;

       private function init():void
       {
           var car_blue:Sprite = new CarBlue();
           addChild( car_blue );
       }

I get the following runtime error:

TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to mx.core.UIComponent.
   at FlexDerby/::init()
   at FlexDerby/___Application1_creationComplete()
   at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction
()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.core::UIComponent/set initialized()
   at mx.managers::LayoutManager/::doPhasedInstantiation()
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at mx.core::UIComponent/::callLaterDispatcher2()
   at mx.core::UIComponent/::callLaterDispatcher()

: : ) Scott

Reply via email to