上一篇介绍了关于在Module中调用Application中的数据,采用的是this.parentApplication方法。这次将介绍如何在Application中调用Module中的参数与方法。

 

Application:

 

通过

<mx:ModuleLoader x="55" y="214" width="919" height="311" id="mm" url="Module/Module2.swf">
 </mx:ModuleLoader>

引入Module2.swf(客户化的模块)

 

在Application中调用Module2.mxml中的公共变量与方法

if(mm.child!=null){
  mm.child.show();
}
 
 
Module:
Module2.mxml中设置了
 
public function show():void{
  Alert.show("Test");
}