Hi,everyone: when the main swf load a module swf located in different
domain,the flex application encount an error: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.allowDomai n("localhost" );
Security.loadPolicy File( "http://localhost: 8888/abflash/ crossdomain.
xml" ); var loader:URLLoader = new URLLoader();
loader.addEventList ener( Event.COMPLETE, loadHandler );
loader.load( new URLRequest(" http://localhost :8888/abflash/
crossdomain. xml")); } private function loadHandler(
evt:Event ):void { //
moduleLoader. url = "http://moduleserve r/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.allowDomai n("localhost" ); } ]]>
</mx:Script> <mx:Button x="32" y="75" label="Button" /> <mx:Label
x="41" y="37" text="fsdsadfsafsad f"/></mx:Module>
Messages in this topic (1)
Reply (via web post)
|
Start a new topic
Messages
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch
format to Traditional
Visit Your Group
|
Yahoo! Groups Terms of Use |
Unsubscribe