跨域訪問安全問題

跨域訪問安全問題,在加載時調用以下函數

 

/**
*返回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());  

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章