什么会导致SecurityErrorEvent?

时间:2011-05-03 01:02:26

标签: flex actionscript-3 security flash-builder firewall

我正在执行以下命令:

var chatRequest:URLRequest = new URLRequest("http://test.com/videophonetest/scripts/get_put_peerID.php?peerID=" + myID);
                chatLoader = new URLLoader(chatRequest);
                configureListenersChatLoader(chatLoader);
                chatLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
                chatLoader.load(chatRequest);

configureListenersChatLoader(chatLoader)和朋友看起来像:

private function configureListenersDeleteLoader(dispatcher:IEventDispatcher):void {
                dispatcher.addEventListener(Event.COMPLETE, completeHandlerDeleteLoader);
                dispatcher.addEventListener(Event.OPEN, openHandler);
                dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
                dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
                dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            }


            private function completeHandlerChatLoader(event:Event):void {              
                writeText("Completed Connection!");
                var urlVariables:URLVariables = new URLVariables(chatLoader.data);
                writeText("Your ID: " + myID);
                theirID = urlVariables.peerID;
                writeText("Their ID: " + theirID);          
            }
            private function completeHandlerDeleteLoader(event:Event):void {                
                writeText("Deletion Complete!");
                var urlVariables:URLVariables = new URLVariables(deleteLoader.data);
                writeText("Deleted: " + urlVariables.deleted);
                writeText("Getting New Chat...");
                initNewChatSession();               
            }

            private function openHandler(event:Event):void {
                writeText("openHandler: " + event);
            }

            private function progressHandler(event:ProgressEvent):void {
                writeText("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
            }

            private function securityErrorHandler(event:SecurityErrorEvent):void {
                writeText("securityErrorHandler: " + event);
            }

            private function httpStatusHandler(event:HTTPStatusEvent):void {
                writeText("httpStatusHandler: " + event);
            }

            private function ioErrorHandler(event:IOErrorEvent):void {
                writeText("ioErrorHandler: " + event);
            }

该命令适用于我的计算机但是当我在室友计算机上尝试它时会返回错误:

httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0 responseURL=null]

securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]

出现这种情况的原因是什么?它适用于某些计算机,但不适用于其他计防火墙?

1 个答案:

答案 0 :(得分:1)

您需要在此设置管理器中允许朋友计算机上文件的位置:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html