Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8478927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:53:01+00:00 2026-06-10T18:53:01+00:00

How do I zip and unzip files using as3 in Air. I am coding

  • 0

How do I zip and unzip files using as3 in Air. I am coding in Flash Professional.

I have tried several tutorials but can’t get it. I am creating this for apps using Adobe Air.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:53:03+00:00Added an answer on June 10, 2026 at 6:53 pm

    check out below my sample code. I tested. and how to link SWC file in Flash, your previous question i wrote.

    here is a sample code. simple_unzip

    import com.coltware.airxzip.ZipEntry;
    import com.coltware.airxzip.ZipError;
    import com.coltware.airxzip.ZipFileReader;
    import com.coltware.airxzip.*;
    
    import flash.filesystem.File;
    import flash.utils.ByteArray;
    import flash.net.FileReference;
    import flash.net.FileFilter;
    
    var file:File;
    var fileReference:FileReference;
    var fileFilter:FileFilter;
    
    function unzip_init():void{
    
        fileFilter = new FileFilter("selected your zip file.", "*.zip; *.gz2; *.bz2;");
        file = new File();
        file.browseForOpen("\Users", [fileFilter]);
        file.addEventListener(Event.SELECT, onSelectedFile);
    }
    
    function onSelectedFile(e:Event):void
    {
        var reader:ZipFileReader = new ZipFileReader();
        reader.open(file);
    
        var list:Array = reader.getEntries();
    
            for each(var entry:ZipEntry in list){
    
                    if(entry.isDirectory()){
                            trace("DIR  --->" + entry.getFilename());
                    }
                    else{
                            trace("FILE --->" + entry.getFilename() + "(" + entry.getCompressRate() + ")");
                    }
            }
    }
    
    unzip_init();
    

    how to save File?

    here is a sample code: simple_unzip2


    import com.coltware.airxzip.ZipEntry;
    import com.coltware.airxzip.ZipError;
    import com.coltware.airxzip.ZipFileReader;
    import com.coltware.airxzip.*;
    
    import flash.filesystem.File;
    import flash.utils.ByteArray;
    import flash.net.FileReference;
    import flash.net.FileFilter;
    import flash.filesystem.FileStream;
    import flash.filesystem.FileMode;
    
    var file:File;
    var fileReference:FileReference;
    var fileFilter:FileFilter;
    var baseDir:File = File.documentsDirectory;
    
    function unzip_init():void{
    
        fileFilter = new FileFilter("selected your zip file.", "*.zip; *.gz2; *.bz2;");
        file = new File();
        file.browseForOpen("\Users", [fileFilter]);
        file.addEventListener(Event.SELECT, onSelectedFile);
    }
    
    function onSelectedFile(e:Event):void
    {
        var reader:ZipFileReader = new ZipFileReader();
        reader.open(file);
    
        var list:Array = reader.getEntries();
        var i:int = 0;
    
        for each(var entry:ZipEntry in list)
        {
            var filename:String = entry.getFilename();
    
            if(entry.isDirectory())
            {
    
                trace("DIR  --->" + entry.getFilename());
                //  If entry is directory
                var dir:File = baseDir.resolvePath(filename);
                dir.createDirectory();
            }
            else
            {
                trace("FILE --->" + entry.getFilename() + "(" + entry.getCompressRate() + ")");
                var unzippedBytes:ByteArray = reader.unzip(entry);
                //trace("btyes --->" + unzippedBytes);
                var file:File = baseDir.resolvePath(entry.getFilename());
                var fs:FileStream = new FileStream();
                fs.open(file,FileMode.WRITE);
                fs.writeBytes(unzippedBytes,0,unzippedBytes.length);
                fs.close();
            }
        }
        reader.close();
    }
    
    unzip_init();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to combine several zip files together using ANT, but I've got three
Is there any external jar that can be used to unzip files using java.Some
I am using 7zip http://www.7-zip.org/download.html in a C# program to unzip files using the
I am using 2 php libraries to serve files- unzip , and dUnzip2 zip
Everything is working fine.. I can Unzip files, from an Zip/Rar .. Archive. The
I am using phonegap for IOS. I created a Plugin to unzip files. But
I need to unzip en zip some files in my application using Shell32. Right
I'm using SevenZIP library files to unzip/extract .exe file. When i tried this approcah
I'm using VCLZip 2.21 to unzip a zip file. I can make TVCLUnzip overwrite
Is it possible to programmatically zip/unzip files in vb.net? Meaning, not that it will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.