<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
private function displayModule(moduleUrl:String):void{
var url:String=moduleLoader.url;
if(url==moduleUrl) return;
if(url!=null) moduleLoader.unloadModule();
moduleLoader.url=moduleUrl;
}
private function first():void{
displayModule("Module/first.swf");
}
private function second():void{
displayModule("Module/seconde.swf");
}
]]>
</mx:Script>
<mx:Canvas x="93" y="25" width="636" height="344">
<mx:ModuleLoader id="moduleLoader" height="100%" width="100%" backgroundColor="#72EE50"/>
</mx:Canvas>
<mx:HBox x="93" y="386" width="635.95" height="46" backgroundColor="#F1A8A8">
<mx:Button label="first" click="first()"/>
<mx:Button label="seconde" click="second()"/>
</mx:HBox>
</mx:Application>
flex 模块加载切换
最新推荐文章于 2019-09-27 14:13:36 发布