跨域访问安全问题,在加载时调用以下函数
/**
*返回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());
本文介绍了一种处理跨域访问安全问题的方法,并通过自定义LoaderContext来控制资源加载过程中的安全策略。
1180

被折叠的 条评论
为什么被折叠?



