跨域訪問安全問題,在加載時調用以下函數
/**
*返回LoaderContext
* @param checkPolicyFile 是否檢測策略文件
* @return
*/
public static function getLoaderContext(checkPolicyFile:Boolean = true):LoaderContext{
if (Admin.URL.indexOf("testadmin2") != -1){
return new LoaderContext(checkPolicyFile, ApplicationDomain.currentDomain, SecurityDomain.currentDomain);
}else{
return new LoaderContext(checkPolicyFile, ApplicationDomain.currentDomain);
}
}
使用
/** 實際導入操作 */
myLoad = new Loader();
myLoad.load(url, getLoaderContext());