簡體   English   中英

錯誤#2044:未處理的IOErrorEvent :。 text =錯誤#2032:流錯誤

[英]Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error

美好的一天,我使用AIR 3.5在Android / IOS App中工作。 在此項目中,我下載了ZIP文件並提取到了特定的文件夾中,然后使用資產(IMG,XML和聲音),一切正常,但是當我加載聲音時,它會一直顯示此錯誤。 錯誤#2044:未處理的IOErrorEvent :。 text =錯誤#2032:流錯誤。 我試圖給它在Android驅動器中的靜態位置,但是發生了同樣的錯誤。 我嘗試使用URLRequest,FileStream,URLStream並發生了同樣的事情。 我在文件夾中找到了所有文件Bath,這使我所有的Bath都正確了。 這是代碼。

trace('AliSoundFile/' + ob.sound);          
var soundFile:File = File.documentsDirectory.resolvePath('AliSoundFile/'+ob.sound);
var files:Array = soundFile.getDirectoryListing();
            trace((File.documentsDirectory.resolvePath('AliSoundFile/'+ob.sound).nativePath) );
//sound = new Sound( new URLRequest ('AliSoundFile/1.mp3'));
sound.addEventListener(IOErrorEvent.IO_ERROR, sound_ioError);
for ( var i:uint = 0 ; i < files.length ; i++)
{
      if (files[i].isDirectory )
    {
       var arr:Array = files[i].getDirectoryListing();
        for ( var j:uint = 0 ;  j <  arr.length ; j++)
        trace('J:-> ',arr[j].nativePath);
    }
    trace('I:-> ',files[i].nativePath);
}
soundStreen = new FileStream();
soundStreen.openAsync(soundFile, FileMode.READ);
soundStreen.addEventListener( Event.COMPLETE, soundStreen_complete); 
soundStreen.addEventListener( IOErrorEvent.IO_ERROR, soundStreen_ioError); 
trace('end');
    private function soundStreen_complete(e:Event):void 
    {
        var ba:ByteArray = new ByteArray(); 
        soundStreen.readBytes( ba );
        _loadSound = new Loader();
        _loadSound.contentLoaderInfo.addEventListener( Event.COMPLETE, soundLoadbytesComplete );
        _loadSound.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadSound_progress);
        _loadSound.loadBytes( ba );
    }

    private function soundLoadbytesComplete(e:Event):void 
    {
        sound.play();
        sound = e.currentTarget.content as Sound;
        soundStreen.close();
    }

任何人都可以幫助我。 謝謝

首先:要處理此未處理的異常,請向contentLoaderInfo添加IOErrorEvent.IO_ERROR的addEventListener。其次:加載程序類用於加載SWF文件或圖像(JPG,PNG或GIF)文件(請參見http://help.adobe.com/zh_cn/ FlashPlatform / reference / actionscript / 3 / flash / display / Loader.html ),因此問題在於您傳遞了無效的流(Sound streem)。 要播放文件,請檢查以下內容: http : //help.adobe.com/zh_CN/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d25.html

我們遇到了類似的2032問題,並且由於Apache 2.4升級而被發現。 從那以后,我們回滾了Apache,一切順利!

即使正在處理IOErrorEvent,我也遇到了此錯誤...或因此,我以為是事實卻是在IOError事件之前觸發了HTTPStatusEvent(在我的情況下為500),並且我在HTTPStatusEvent中刪除了事件偵聽器IOError事件之前的處理程序。 德普

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM