问题是:我有(例如)字体嵌入类,并且我想从应用程序存储文件夹中加载外部SWF,但不是另一个本地路径(“D:\ blah-blah \ 123.swf“)在空气中,但你知道我不能在互联网上找到(谷歌,Adode.com)从另一个沙箱中的内容加载外部类
Security.allowDomain() not working in AIR (documented on adobe.com)
Trick with ApplicationDomain is not working (same documented on adobe.com)
任何决定我要的,是获得类参考从加载内容并在加载启动器中使用。
有谁知道如何解决这个问题?
_
_
[主AIR-应用代码片]
// function and one param (path to content)
function tralala(_swfPath : String)
{
var l : Loader = new Loader();
l.contentLoaderInfo.
addEventListener(Event.COMPLETE,
function(_e : Event)
{
var tmp = _e.target.content;
// call function from SWF and retrieving
// classes, but can't work with them
Font.registerFont(tmp._getRef()[0]);
// no error checking for clarity
}
);
l.load(new URLRequest(_swfPath));
}
_
_
:用于获取初识列表代码
[外部SWF代码]
function _getRef() : Array
{
// class1,2,3 are font classes imported in library
return [ class1, class2, class3];
}
Thx回复。希望它能帮助别人。 – Focker 2011-07-28 20:51:29