loader 如何可以得到SecurityErrorEvent 事件,试了多种方法不可以
复制内容到剪贴板
代码:
var imageLdr = new Loader();
imageLdr.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
imageLdr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
imageLdr.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
imageLdr.load(new URLRequest("http://static.flickr.com/12/68478787_587123307b_m.jpg"));
} catch (e:Error) {
trace("securityErrorHandler")
this.t.text="securityErrorHandler"
}
function initHandler(event:Event):void {
var imageMc = new MovieClip();
event.target.loader.content.smoothing=true;
imageMc.addChild(event.target.loader.content);
addChild(imageMc);
}
function ioError(e:Event){
trace("securityErrorHandler")
this.t.text="securityErrorHandler"
}
function securityErrorHandler(e:Event){
trace("securityErrorHandler")
this.t.text="securityErrorHandler"
}