2009-08-04 21 views

Trả lời

5

Sự cố xảy ra với việc định vị sai các mô-đun SWF. Ngay khi vị trí thích hợp được đặt cho các mô-đun SWF được tạo - lỗi sẽ biến mất.

+2

Bạn giải quyết vấn đề một cách chính xác như thế nào? – bks

+0

Trong trường hợp của tôi, sự cố cũng xảy ra khi tải nội dung, không chỉ các mô-đun .swf. (Tôi đã sửa nó bằng cách sử dụng các URL tuyệt đối: '' '/ dir/someSWFFile.swf''' thay vì' '' someSWFFile.swf''') –

6

Đừng quên bạn cũng có thể thêm trình nghe IOErrorEvent vào bộ tải, vì vậy bạn có thể theo dõi thêm một chút thông tin cho chính mình. Mã dưới đây là một khởi động chung, nó có thể sẽ cần thêm một chút thông tin trước khi nó thực sự hoạt động trong flash/flex.

swfLoaderInstance:SWFLoader = new SWFLoader(); 
swfLoaderInstance.source = "someSWFFile.swf"; 
swfLoaderInstance.addEventListener(IOErrorEvent.IO_ERROR, handleError); 

public function handleError(event:IOErrorEvent):void{ 
    trace(event.target); 
    //etc... 
} 
1

Nếu đó là điều trình duyệt internet và bạn đang sử dụng Google Chrome. Truy cập Histor>Clear all browsing Data. Chỉ đánh dấu vào những lỗi này, bạn sẽ không muốn mất dữ liệu duyệt web.

Xóa bộ nhớ cache, Xoá cookie và trang web khác và plug-in dữ liệu, rõ ràng lưu Tự động điền dữ liệu mẫu

Rõ ràng nó từ đầu thời gian. Sau đó thử tải thứ bạn muốn. Làm việc cho tôi tốt :)

1

Tôi đã có thông báo lỗi tương tự. Trong trường hợp của tôi, đó là do việc thu gom rác thải Loader.

Đây là mã tôi có vấn đề với:

private function loadImageFromUrl(imageUrl:String):AbstractOperation 
    { 
     var result:AbstractOperation = new AbstractOperation(); 

     var loader:Loader = new Loader(); 
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void 
     { 
      result.dispatchCompleteEvent(loader.content); 
     }); 
     loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (event:IOErrorEvent):void 
     { 
      result.dispatchErrorEvent(event); 
     }); 
     loader.load(new URLRequest(imageUrl)); 

     return result; 
    } 

Và đây là mã tốt:

private var m_loaderReferences:Dictionary = new Dictionary(); 

private function loadImageFromUrl(imageUrl:String):AbstractOperation 
    { 
     var result:AbstractOperation = new AbstractOperation(); 

     var loader:Loader = new Loader(); 
     m_loaderReferences[imageUrl] = loader; // Need to keep a reference to the loader to avoid Garbage Collection 
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void 
     { 
      result.dispatchCompleteEvent(loader.content); 
      delete m_loaderReferences[imageUrl]; 
     }); 
     loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (event:IOErrorEvent):void 
     { 
      result.dispatchErrorEvent(event); 
      delete m_loaderReferences[imageUrl]; 
     }); 
     loader.load(new URLRequest(imageUrl)); 

     return result; 
    } 

tôi tham khảo các bộ nạp từ một từ điển để tránh GC. Tôi xóa bộ nạp khỏi Từ điển khi tải xong.

Các vấn đề liên quan