1 Reply Latest reply on May 25, 2010 8:35 AM by bringrags

    SWC as MediaElement




      I think this question is more advanced but is it possible to cast a instance of a SWC to a MediaElement so I can add it to a composition? What I did is: I created  SWC-Flex Component in Flash and use it in Flex now. I can't work with SWF because I access the parameters of the SWC-Component at runtime.


      A simple:


      serialElement.addChild(swcComponent as MediaElement);


      doesn't work

        • 1. Re: SWC as MediaElement
          bringrags Level 4

          You would need to create a subclass of MediaElement that uses the SWC.  I'm not sure how this would work with a SWC, but we've done similar examples using SWFs.  See SWFElement from the framework code, or some of the examples in ExamplePlayer (such as "Chromeless SWF", which uses a subclass of SWFElement to load a specific SWF and map the SWFElement's traits to the API exposed by that SWF).