Unloading a module using ActionScript
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> private function unloadMyModule():void { MyModule.unloadModule(); } </mx:Script> <mx:ModuleLoader url="a.swf" x="100" y="100" width="356" height="274" id="MyModule" /> <mx:Button x="348" y="382" label="Unload Module" id="unloadBtn" click="unloadMyModule()" /> </mx:Application>