Another one method is to create Flex wrapper application, load your flash.swf
into it, and then load flex.swf into flash, it's simple:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; paddingBottom="0"
paddingTop="0" paddingLeft="0" paddingRight="0">
        <mx:SWFLoader scaleContent="false" id="desktop"
                                  width="100%" height="100%"
source="flash.swf"
                                  resize="if(desktop.content)
desktop.content['setSize'](desktop.width, desktop.height);"
                                 
complete="desktop.content['setSize'](desktop.width, desktop.height);"/>
</mx:Application>


There flash.swf is your flash app that loads flex app and setSize must be a
public function in flashh.swf to arrange it when resizing occurs(if you need
it) 


azona26 wrote:
> 
> Hello All ---
> 
> I am just moving into Flex 3 from Flash CS3/AS3 and am trying to import a
> Flex compiled SWF into Flash. I followed this tutorial, which seems to
> work well:
> 
> http://seeing-is-believing.blogspot.com/2007/11/flex-components-in-flash-example-with.html
> 
> If I put the code on a frame in Flash, not using any custom document class
> everything works fine. However, when I try and load the Flex SWF into my
> Flash Document class via a custom class loading file which basically
> implements the prior referenced code, I get the following error:
> 
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>     at mx.managers::LayoutManager/set
> usePhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:325]
>     at
> mx.core::Application()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Application.as:274]
>     at CDForm()[C:\TriggerFish FLEX\src\CDForm.mxml:0]
>     at _CDForm_mx_managers_SystemManager/create()
>     at
> mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2438]
>     at
> mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2330]
> 
> Any insight into why I am getting this error:
> 
> Thanks for any and all replies.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Load-Flex-SWF-into-Flash---Error-Msg-tp15885686p22538483.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to