我已经创建了一个flex应用程序,我希望使用第三方库(swc)的方式
基本上,我希望有一个可选的动态(运行时)链接到用户端本地存储的swc。如果swc可用,我的swf应该能够使用它,否则它就不需要使用了。
有可能吗?
发布于 2016-03-04 03:19:14
我不确定SWC,但这是我如何使用SWF。请注意,我正在从不同的部分复制代码,所以您可能需要对其进行微调
var the_cls:Class;
// First, load SWF with classes:
var request:URLRequest = new URLRequest( u );
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event){
// then get class from the file, you can do it for few classes
the_cls = e.target.applicationDomain.getDefinition("my_ldd_class_name") as Class;
});
loader.load(request, new LoaderContext(false, ApplicationDomain.currentDomain));
// then use class in your application:
the_obj = new the_cls();
the_obj.the_func();https://stackoverflow.com/questions/35774591
复制相似问题