AS3 UrlLoader does not fire Event.COMPLETE



除了Event.Complete…(这意味着我在服务器端检索到了好的内容,进度事件按预期工作)

我有一个处理上传的简单代码。我使用这个类:https://github.com/Nek-/Multipart.as/blob/master/src/com/jonas/net/Multipart.as

我的代码:

package com.foo.http 
{
    import com.jonas.net.Multipart;
    import flash.net.*;
    import flash.events.*;
    import flash.utils.ByteArray;
    import flash.external.ExternalInterface;
    public class RequestManager
    {
        private var request:Multipart;
        private var loader:URLLoader;
        /**
         * The url can be http://foobar:952/helloworld
         * @param   url
         */
        public function RequestManager(url:String)
        {
            this.loader = new URLLoader();
            this.request = new Multipart(url);
            // This is needed, if we don't set it, the complete event will never be trigger
            // We retrieve some text
            this.loader.dataFormat = URLLoaderDataFormat.TEXT;
            // Events
            this.attachEvents();
        }
        public function getRequest():Multipart
        {
            return this.request;
        }
        public function send():void
        {
            this.loader.load(this.request.request);
        }
        private function attachEvents():void
        {
            this.loader.addEventListener(Event.COMPLETE, this.requestCompleted);
            this.loader.addEventListener(ProgressEvent.PROGRESS, this.requestProgress);
            this.loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.securityError);
            this.loader.addEventListener(IOErrorEvent.IO_ERROR, this.networkError);
        }
        // Of course there is also listener methods (with a trace inside and call to JS, nothing more)
    }
}

知道它是从什么来的吗?

我的问题似乎不是来自actionscript或flash本身,而是来自我的javascript和firefox上的flash调试器。

最新更新