【发布时间】:2009-03-18 16:44:58
【问题描述】:
目前我正在开发一个大量使用外部 SWF 的应用程序 (Flex)。 我想创建一个静态方法,它将文件名作为参数并返回包装在其他类中的 SWF。
public static function getSWFWrapperFromFile(path:string):SWFWrapper {
var loader:SWFLoader = new SWFLoader();
loader.addListener(Event.COMPLETE, onLoad);
loader.load(path);
// If I create new SWFWrapper object here and try to assign it the loader.content I get null reference
}
但是,由于非阻塞 load() 和 onLoad 处理程序的需要,使用这种方法我无法将逻辑封装在一个函数中。调用加载方法后是否有可能强制延迟?或者也许还有其他更好的方法?
谢谢, 阿朗佐
【问题讨论】:
标签: apache-flex flash swfloader