Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If your <code>obb</code> file is like any other <code>zip</code> file then you can treat it as such. First you will want a list of files to extract (could be all your files who knows). </p> <p>Here is one way to get the files out :</p> <pre><code> private function obbFileUnpackingRoutine(event:Event):void{ addChild(obbUnpackScreen); obbUnpackScreen.obbProgress.scaleX = zipCount/filesToUnpack.length; setChildIndex(obbUnpackScreen, numChildren -1); for (var i:uint = 0; i&lt;24; i++){ if (zipCount == filesToUnpack.length){ zipDone = true; removeEventListener(Event.ENTER_FRAME, obbFileUnpackingRoutine); removeChild(obbUnpackScreen); var fr:FileStream=new FileStream(); var str:String = File.applicationStorageDirectory.nativePath; var cacheDir= new File(str +"/YourSettings"); fr.open(cacheDir.resolvePath("isObbUnpacked.pnr"),FileMode.WRITE); fr.writeObject([zip.getFileCount(),zipCount]); fr.close(); return } var file:FZipFile = zip.getFileByName(filesToUnpack[zipCount]) var cacheDir:File= null; var str:String = File.applicationStorageDirectory.nativePath; cacheDir= new File(str); var fileContents = file.content var fr:FileStream=new FileStream(); fr.open(cacheDir.resolvePath(file.filename),FileMode.WRITE); fr.writeBytes(fileContents); fr.close(); zipCount++; } } </code></pre> <p>If memory permits you may want to load your files directly from the zip file so you don't have to unpack them. Any file that can only accessed with a urlRequest will of course have to be extracted But you can load png files, mp3 files, and your own custom files with byteArrays</p> <p>My obb file has thousands of tiny mp3 files and it can take upto 3 minutes to extract on an allWinner A10 processor. Direct loading means it can get the files instantly. And there is almost no delay at all.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload