Извините за путаницу. Для добавления многопоточности в вашем коде, необходимо использовать класс Worker из пакета flash.system. Вот пример, как вы можете изменить ваш код для добавления многопоточности:

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.EventDispatcher;
import flash.events.ProgressEvent;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.net.URLRequest;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequestMethod;
import flash.net.URLLoader;
import flash.net.URLStream;
import flash.net.URLVariables;
import flash.utils.ByteArray;
import deng.fzip.FZip;
import deng.fzip.FZipFile;

public class ZIPResourceLoader extends EventDispatcher
{
    // …

    private var worker:Worker; // Добавляем переменную для работы с потоками

    public function ZIPResourceLoader(progressBar:ProgressBar)
    {
        this.progressBar = progressBar;
        zipLoader.dataFormat = URLLoaderDataFormat.TEXT;
        zipLoader.addEventListener(Event.COMPLETE, onVersionLoaded);
        zipLoader.addEventListener(IOErrorEvent.IO_ERROR, onVersionLoadError);
        zipLoader.load(new URLRequest(versionURL));
        
        // Создаем новый Worker и его через SharedObject из байтов из вашего скомпилированного SWF-файла
        var bytes:ByteArray = new MyWorkerClass(); // Замените “MyWorkerClass” на вашу собственную Worker-класс
        worker = WorkerDomain.current.createWorker(bytes);
        worker.addEventListener(Event.WORKER_STATE, onWorkerStateChange);
        worker.start();
    }
    
    // …
    
    public function extractLocalArchive():void
    {
        worker.addEventListener(ProgressEvent.PROGRESS, onWorkerProgress);
        worker.addEventListener(Event.COMPLETE, onWorkerComplete);
        worker.setSharedProperty(“localFilePath”, localFilePath);
        worker.setSharedProperty(“targetFolder”, resourcesFolder);
        worker.setSharedProperty(“zipFileURL”, localFilePath);
        worker.setSharedProperty(“zipFileCount”, zipFile.getFileCount());
        worker.setSharedProperty(“extractedFileCount”, 0);
        worker.setSharedProperty(“success”, true);
        worker.start();
    }

    private function onWorkerProgress(event:ProgressEvent):void
    {
        var percent:Number = event.bytesLoaded / event.bytesTotal;
        dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, event.bytesLoaded, event.bytesTotal));
    }

    private function onWorkerComplete(event:Event):void
    {
        // Обработка завершения работы Worker
        var success:Boolean = worker.getSharedProperty(“success”);
        if(success){
            Alert.showMessage(“Extracted successfully!”);
            progressBar.progressBar.visible = false;
        } else {
            var errorMessage:String = worker.getSharedProperty(“errorMessage”);
            Alert.showMessage("Failed to extract resources.zip: " + errorMessage);
        }
        
        worker.removeEventListener(ProgressEvent.PROGRESS, onWorkerProgress);
        worker.removeEventListener(Event.COMPLETE, onWorkerComplete);
        worker.terminate();
    }
    
    private function onWorkerStateChange(event:Event):void
    {
        if (worker.state == WorkerState.RUNNING) {
            worker.setSharedProperty(“localFilePath”, localFilePath);
            worker.setSharedProperty(“targetFolder”, resourcesFolder);
        }
    }
}


Нужно создать дополнительный класс Worker, чтобы обработать процесс распаковки архива в отдельном потоке. Затем можно изменить метод extractLocalArchive, чтобы передать необходимые данные в Worker и начать его работу.

import flash.system.Worker;
import flash.events.Event;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.utils.ByteArray;
import deng.fzip.FZip;
import deng.fzip.FZipFile;

public class MyWorkerClass{
    private var localFilePath:String;
    private var targetFolder:File;
    private var zipFileURL:String;
    private var zipFileCount:int;
    private var extractedFileCount:int;
    private var success:Boolean;
    private var errorMessage:String;
    
    public function MyWorkerClass(){
        Worker.current.addEventListener(Event.WORKER_STATE, onWorkerStateChange);
    }

    private function onWorkerStateChange(event:Event):void
    {
        if (Worker.current.state == WorkerState.RUNNING) {
            localFilePath = Worker.current.getSharedProperty(“localFilePath”);
            targetFolder = Worker.current.getSharedProperty(“targetFolder”);
            zipFileURL = Worker.current.getSharedProperty(“zipFileURL”);
            zipFileCount = Worker.current.getSharedProperty(“zipFileCount”);
            extractedFileCount = Worker.current.getSharedProperty(“extractedFileCount”);
            success = Worker.current.getSharedProperty(“success”);
            errorMessage = null;
            
            extractFiles();
        }
    }

    private function extractFiles():void
    {
        try {
            var zipFile:FZip = new FZip();
            var zipFileStream:FileStream = new FileStream();
            zipFileStream.open(new File(zipFileURL), FileMode.READ);
            zipFileStream.readBytes(zipFile.loadBytes);
            zipFileStream.close();

            for (var i:int = 0; i < zipFile.getFileCount(); i++)
            {
                var zipEntry:FZipFile = zipFile.getFileAt(i);
                var targetFilePath:String = targetFolder.nativePath + File.separator + zipEntry.filename;
                var targetFile:File = new File(targetFilePath);

                if (zipEntry.filename.charAt(zipEntry.filename.length - 1) == “/”) {
                    targetFile.createDirectory();
                } else {
                    var targetFileStream:FileStream = new FileStream();
                    targetFileStream.open(targetFile, FileMode.WRITE);
                    targetFileStream.writeBytes(zipEntry.content);
                    targetFileStream.close();
                }

                extractedFileCount допиши что ты не успел дописать и оборвался вот код мой  package zip
{
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.EventDispatcher;
    import flash.events.ProgressEvent;
    import flash.filesystem.File;
    import flash.filesystem.FileMode;
    import flash.filesystem.FileStream;
    import flash.net.URLRequest;
    import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequestMethod;
    import flash.net.URLLoader;
    import flash.net.URLStream;
	import flash.net.URLVariables;
    import flash.utils.ByteArray;
    import deng.fzip.FZip;
    import deng.fzip.FZipFile;

    public class ZIPResourceLoader extends EventDispatcher
    {
        public var resourcesURL:String = "https://redagereborn.ru/resources.zip";
        public var versionURL:String = "https://redagereborn.ru/version.txt";
        public var localFilePath:String = File.applicationStorageDirectory.nativePath + File.separator + "resources.zip";
        public var versionFile:File = new File(File.applicationStorageDirectory.nativePath + File.separator + "version.txt");
        public var zipLoader:URLLoader = new URLLoader();
        private var progressBar:ProgressBar;
		public static const PROGRESS_UPDATE:String = "progressUpdate";
		
        public function ZIPResourceLoader(progressBar:ProgressBar)
        {
			this.progressBar = progressBar;
            zipLoader.dataFormat = URLLoaderDataFormat.TEXT;
            zipLoader.addEventListener(Event.COMPLETE, onVersionLoaded);
            zipLoader.addEventListener(IOErrorEvent.IO_ERROR, onVersionLoadError);
            zipLoader.load(new URLRequest(versionURL));
        }

        public function onVersionLoaded(event:Event):void
        {
            var remoteVersion:Number = Number(zipLoader.data);

            var versionLoader:URLLoader = new URLLoader();
            versionLoader.dataFormat = URLLoaderDataFormat.TEXT;
            versionLoader.addEventListener(Event.COMPLETE, onLocalVersionLoaded);
            versionLoader.addEventListener(IOErrorEvent.IO_ERROR, onLocalVersionLoadError);
            versionLoader.load(new URLRequest(versionFile.nativePath));

            function onLocalVersionLoaded(event:Event):void {
                var localVersion:Number = Number(versionLoader.data);
                if (localVersion != remoteVersion) {
			        startDownloadProcess();
                } else {
                    Alert.showMessage("Local version is up to date");
				       progressBar.progressBar.visible = false;
                    // Пропущен код для распаковки архива
                }
            }
			
	        function onLocalVersionLoadError(event:IOErrorEvent):void {
                // Создаем новый файл version.txt и записываем в него пустую строку
                var fileStream:FileStream = new FileStream();
                fileStream.open(versionFile, FileMode.WRITE);
                fileStream.writeUTFBytes("");
                fileStream.close();
                // Запускаем процесс загрузки и распаковки архива
                startDownloadProcess();
            }
        }
		
		public function onDownloadProgress(event:ProgressEvent):void 
		{
            progressBar.setProgress(event.bytesLoaded, event.bytesTotal);
        } 

        private function startDownloadProcess():void 
		{
            Alert.showMessage("Downloading resources.zip");
			progressBar.progressBar.visible = true;
            var downloadStream:URLStream = new URLStream();
			downloadStream.addEventListener(ProgressEvent.PROGRESS, onDownloadProgress);
            downloadStream.addEventListener(Event.COMPLETE, onDownloadComplete);
            downloadStream.addEventListener(IOErrorEvent.IO_ERROR, onDownloadError);
            downloadStream.load(new URLRequest(resourcesURL));
        }
		
        public function onProgressUpdate(event:ProgressEvent):void 
		{
            progressBar.progress = event.bytesLoaded / event.bytesTotal;
            progressBar.updateProgressBar();
        }
	
        public function onVersionLoadError(event:IOErrorEvent):void
        {
			progressBar.progressBar.visible = false;
			progressBar.incilizationProgressBar();
            Alert.showMessage("Failed to load version.txt");
        }

        private function updateLocalVersion(remoteVersion:Number):void 
		{
            var fileStream:FileStream = new FileStream();
            fileStream.open(versionFile, FileMode.WRITE);
            fileStream.writeUTFBytes(remoteVersion.toString());
            fileStream.close();
        }
		
        public function onDownloadComplete(event:Event):void
        {

	      //var percent:Number = events.bytesLoaded / events.bytesTotal;
          //dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, events.bytesLoaded, events.bytesTotal));
            var downloadStream:URLStream = event.target as URLStream;
            var fileBytes:ByteArray = new ByteArray();
            downloadStream.readBytes(fileBytes);

            var fileStream:FileStream = new FileStream();
            fileStream.open(new File(localFilePath), FileMode.WRITE);
            fileStream.writeBytes(fileBytes, 0, fileBytes.length);
            fileStream.close();

            //Alert.showMessage("Downloaded resources.zip");
            var remoteVersion:Number = Number(zipLoader.data); // Получаем удаленную версию файла
            updateLocalVersion(remoteVersion); // Обновляем локальную версию файла
            extractLocalArchive();
        }

        public function onDownloadError(event:IOErrorEvent):void
        {
            Alert.showMessage("Failed to download resources.zip");
        }

        public function extractLocalArchive():void
        {
            var resourcesFolder:File = new File(File.applicationStorageDirectory.nativePath + File.separator + "cache/resources");
            if (resourcesFolder.exists && resourcesFolder.isDirectory)
            {
                resourcesFolder.deleteDirectory(true); // Удаление папки “resources” с ее содержимым
            }
    
            var zipFile:FZip = new FZip();
            zipFile.addEventListener(Event.COMPLETE, onZipExtracted);
            zipFile.load(new URLRequest(localFilePath));
        }

        public function onZipExtracted(event:Event):void
        {
            var zipFile:FZip = event.target as FZip;

            try {
                for (var i:int = 0; i < zipFile.getFileCount(); i++)
                {
                    var zipEntry:FZipFile = zipFile.getFileAt(i);
                    var targetFilePath:String = File.applicationStorageDirectory.nativePath + File.separator + "cache/resources" + File.separator + zipEntry.filename;
                    var targetFile:File = new File(targetFilePath);

                    if (zipEntry.filename.charAt(zipEntry.filename.length - 1) == "/") {
                        targetFile.createDirectory();
                    } else {
                        var targetFileStream:FileStream = new FileStream();
                        targetFileStream.open(targetFile, FileMode.WRITE);
                        targetFileStream.writeBytes(zipEntry.content);
                        targetFileStream.close();
                    }
                }
                // Закрываем архив
                zipFile.close();
                // Удаляем архив
                var file:File = new File(localFilePath);
                file.deleteFile();
				
                Alert.showMessage("Extracted successfully!");
				progressBar.progressBar.visible = false;
                } catch (error:Error) {
                    Alert.showMessage("Failed to extract resources.zip: " + error.message + " (" + error.errorID + ")");
                }
        }

        private function versionIsUpToDate(version:Number):Boolean
        {
            if (versionFile.exists) {
                var fileStream:FileStream = new FileStream();
                fileStream.open(versionFile, FileMode.READ);
                var localVersion:Number = Number(fileStream.readUTFBytes(fileStream.bytesAvailable));
                fileStream.close();
                return version == localVersion; // Возвращает true, если версии совпадают.
            }
            return false;
        }
    }
}