when I set  the ModuleLoader.url 
= http://localhost:8888/abflashFlexTest/trade.swf;the flex application encount 
an error that :"Error #1014: mx.core::LayoutContainer could not be found".
(1)I have add a crossdomain.xml on the server side<?xml 
version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM 
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd";><cross-domain-policy>
  <allow-access-from domain="*" />        <allow-http-request-headers-from 
domain="*" headers="*"/></cross-domain-policy>(2)In the main SWF:               
 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" 
creationComplete="appInit()" preinitialize="initHandler();">      
<mx:Script>         <![CDATA[              private function initHandler():void  
            {                  Security.allowDomain("localhost");               
   Security.loadPolicyFile( "http://localhost:8888/abflash/crossdomain.xml"; );  
                var loader:URLLoader = new URLLoader();                  
loader.addEventListener( Event.COMPLETE, loadHandler );                
  loader.load(new URLRequest("http://localhost:8888/abflash/crossdomain.xml";)); 
             }              private function loadHandler( evt:Event ):void      
        {                              // moduleLoader.url = 
"http://moduleserver/modules/MyModule.swf";;              }          ]]>     
</mx:Script> (3)In the Module SWF:  <mx:Module 
xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" width="400" 
height="300" initialize="initHandler();">        <mx:Script>         <![CDATA[  
            private function initHandler():void              {                  
Security.allowDomain("localhost");              }          ]]>     
</mx:Script>          <mx:Button x="32" y="75" label="Button"/>       <mx:Label 
x="41" y="37" text="fsdsadfsafsadf"/></mx:Module>


      

Reply via email to