Apache flex Flex:将父类加载到模块中

Apache flex Flex:将父类加载到模块中,apache-flex,module,Apache Flex,Module,我的主应用程序包含一个ClassA。然后,主应用程序加载一个模块,在该模块中,我希望执行以下操作: var classA:InterfaceClassA = new ClassA(); 它编译得很好,但我得到以下警告: Warning: YourApplication is a module or application that is directly referenced. This will cause YourApplication and all of its dependencie

我的主应用程序包含一个
ClassA
。然后,主应用程序加载一个模块,在该模块中,我希望执行以下操作:

var classA:InterfaceClassA = new ClassA();
它编译得很好,但我得到以下警告:

Warning: YourApplication is a module or application that is directly referenced. This will cause YourApplication and all of its dependencies to be linked in with module.YourModule:Module. Using an interface is the recommended practice to avoid this.
我不能使用接口来生成新实例,那么正确的方法是什么

我从中找到了答案。我在主应用程序中创建了一个helper类,其中包含我要访问的类的实例。在模块中,我使用:

parentApplication.myModuleHelper.**myClassInstance**.myMethod();
例如,我使用的实例方法和静态类级方法:

parentApplication.myModuleHelper.**MyClassInstance**.myMethod()
要在模块中获取我的类的实例,我在MyModuleHelper中使用它

public function getFullScreenUtil(iFullScreenUtil:IFullScreenUtil , iSystemManager:ISystemManager):FullScreenUtil {
    return new FullScreenUtil(iFullScreenUtil , iSystemManager);
}
在MyModule中:

var _fullScreenUtil:* = parentApplication.moduleHelper.getFullScreenUtil(this , systemManager);

这就是我现在所需要的。我不确定如何将
getFullScreenUtil(..)
的结果转换为
FullScreenUtil
的实际实例,但我希望这不能在模块中完成。也许使用接口可以解决这个问题。

比这更好的应该是在编译主应用程序时使用-link report,然后在编译模块时使用-load externs。要不是我,这本应该奏效的。Flex类被排除在外,但应用程序中的自定义类没有被排除,即使它们在生成的链接报告中。