PDA

View Full Version : Viewing and Using Flex SWFs in Flash


spectrum302
05-09-2007, 10:33 PM
Is there anyway of using a compiled flex component in other words a SWF file created by flex and that loading it into a flash document.

Currently the flash doc is done in AS2, and I dont really want to change that right now, though I dont think It should make a difference.

the code I'm using to try and accomplish this is

loadMovie("ServicesPanel.swf", "servicesPanelClip");


Alternatively if I were to load the flash SWF instead through a flex app, would there be a way to 'swap out' a current symbol with a flex component. I imagone it would go something like

ImportedFlashClip.content."no idea what goes in here";

dr_zeus
05-10-2007, 05:33 PM
A SWF file created for Flash 8 or below cannot load a SWF file created for Flash 9/Flex 2.

korinj1
09-01-2007, 09:07 AM
Hi there, I have a similar problem. I've written a component in Flex and compiled it to SWF. Now I'm looking for a way how to load and set up the component to a Flash application.
If the security sandbox is the same, you can load Flex SWF into Flash SWF by using the Loader class, BUT:

ONLY if the loading code is in the 1st frame, NOT in the document class. If the code is in the document class, the compiler says:
Error: Error #2136: The SWF file file:///D|/Projects/Swf/Janko/SampleFlashApp/Bar.swf contains invalid data.
at _Bar_mx_managers_SystemManager/create()
at mx.managers::SystemManager/::initializeTopLevelWindow()
at mx.managers::SystemManager/::docFrameHandler()

Can anyone tell me why and how to fix this? Has anyone an experience with loading Flex SWF into Flash?

Thanks for an advice

dr_zeus
09-04-2007, 09:17 PM
Are you loading the SWF file in the constructor? This may seem weird, but try waiting a frame or two (or a short time-based interval, if you prefer), and then try to load the SWF. My guess is that the Flex SystemManager is trying to access the stage or the root too early.