跨域访问安全问题,在加载时调用以下函数
/**
*返回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());