問題是:我有(例如)字體嵌入類,並且我想從應用程序存儲文件夾中加載外部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