1

错误 #2044:未处理的安全错误:。文本=错误 #2048:违反安全沙箱:

我该如何处理?

4

1 回答 1

2

这似乎奏效了。不管怎么说,多谢拉。

import flash.events.SecurityErrorEvent;

loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, SecurityErrorEventExample);

function SecurityErrorEventExample() {
    var loader: URLLoader = new URLLoader();
    loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    var request: URLRequest = new URLRequest("http://www.perdanadesigns.com");
    loader.load(request);
}

function securityErrorHandler(event: SecurityErrorEvent): void {
    trace("securityErrorHandler: " + event);
}
于 2009-09-21T18:08:58.910 回答