Created
September 17, 2015 03:04
-
-
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'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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