Packagecom.myflashlab.air.extensions.zip
Classpublic class ZipManager
InheritanceZipManager Inheritance flash.events.EventDispatcher

ZipManager class will zip or unzip big, big zip archives super fast as it is using native process in threads supporting both Android and iOS. you will have listeners to watch the process progress.

View the examples



Public Methods
 MethodDefined By
  
ZipManager
  
cancelUnzipping($removeDir:Boolean):Boolean
Call this if you wish to stop the unzipping process
ZipManager
  
cancelZipping($removeZip:Boolean):Boolean
Call this to cancel the zipping process.
ZipManager
  
dispose():void
Call to dispose the extension
ZipManager
  
unzip($zipFile:File, $location:File):void
Call to start unzipping a specified zip file to your target dir location
ZipManager
  
zip($zipFile:File, $targetDir:File):void
Call to start zipping a directory and everything in it!
ZipManager
Public Constants
 ConstantDefined By
  EXTENSION_ID : String = com.myflashlab.air.extensions.zipManager
[static]
ZipManager
  VERSION : String = 3.1.21
[static]
ZipManager
Constructor Detail
ZipManager()Constructor
public function ZipManager()



Method Detail
cancelUnzipping()method
public function cancelUnzipping($removeDir:Boolean):Boolean

Call this if you wish to stop the unzipping process

Parameters

$removeDir:Boolean — if set to true the tmp directory will be deleted also.

Returns
Boolean
cancelZipping()method 
public function cancelZipping($removeZip:Boolean):Boolean

Call this to cancel the zipping process.

Parameters

$removeZip:Boolean — if set to true the tmp zip file will also be deleted.

Returns
Boolean
dispose()method 
public function dispose():void

Call to dispose the extension

unzip()method 
public function unzip($zipFile:File, $location:File):void

Call to start unzipping a specified zip file to your target dir location

Parameters

$zipFile:File
 
$location:File

zip()method 
public function zip($zipFile:File, $targetDir:File):void

Call to start zipping a directory and everything in it!

Parameters

$zipFile:File
 
$targetDir:File

Constant Detail
EXTENSION_IDConstant
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.zipManager

VERSIONConstant 
public static const VERSION:String = 3.1.21

Examples
use the extension like this:
     import com.myflashlab.air.extensions.zip.
          var _ex:ZipManager = new ZipManager();
     _ex.addEventListener(ZipManagerEvent.START, onStart);
     _ex.addEventListener(ZipManagerEvent.ERROR, onError);
     _ex.addEventListener(ZipManagerEvent.PROGRESS, onProgress);
     _ex.addEventListener(ZipManagerEvent.COMPLETED, onComplete);
     
     _ex.unzip(File.applicationStorageDirectory.resolvePath("TheZipFile.zip"), File.applicationStorageDirectory.resolvePath("unzipLocation"));
     
     function onStart(e:ZipManagerEvent):void
     {
             trace("zip process started...");
     }
     
     function onError(e:ZipManagerEvent):void
     {
             trace("zip process ERROR: " + e.param.msg);
     }
     
     function onProgress(e:ZipManagerEvent):void
     {
             trace("zip Progress = " + e.param.perc + "%");
     }
     
     function onComplete(e:ZipManagerEvent):void
     {
             trace("[zip process finished]");
     }