Skip to content

Instantly share code, notes, and snippets.

@marchbold
Created September 17, 2015 03:04
Show Gist options
  • Save marchbold/a85fcc502389f90a7c1b to your computer and use it in GitHub Desktop.
Save marchbold/a85fcc502389f90a7c1b to your computer and use it in GitHub Desktop.
Simple example of unzipping a packaged file 'packaged.zip' to the storage directory 'unzip_dir'
ZipUtils.init( "APP_KEY" );
if (ZipUtils.isSupported)
{
ZipUtils.service.addEventListener( ZipUtilsEvent.UNZIP_COMPLETE, unzip_completeHandler );
ZipUtils.service.addEventListener( ZipUtilsEvent.UNZIP_ERROR, unzip_errorHandler );
ZipUtils.service.unzip(
File.applicationDirectory.resolvePath( "packaged.zip" ).nativePath,
File.applicationStorageDirectory.resolvePath( "unzip_dir" ).nativePath,
true );
}
...
private function unzip_completeHandler( event:ZipUtilsEvent ):void
{
trace( "unzip complete" );
}
private function unzip_errorHandler( event:ZipUtilsEvent ):void
{
trace( "error" );
}
// com.distriqt.ZipUtils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment