Search code examples
actionscript-3airadobeembeddingflash-builder

ZIP Embedding throws error


I want to embed a ZIP-file into my AS3/Air-application (with Flash Builder) and open it via FZip. For embedding, I use this code:

[Embed(source='../bin/art/resources.zip', mimeType="application/octet-stream")]
public static const rsClass:Class;

When I try to save the project the program chrashes and throws an error:

"Workspace is being build" has encountered a problem. During "Workspace is being build" an internal error has occured. (this is just a bad translation, not original) Java heap space

I click OK, the internal error appears:

The error "Disc space too low" has appeared. Look into the Readme-File at "Run Eclipse" you will find information [...] It is recommended to end the workbench. Do you want to end the workbench? yes/no

In an earlier version of this post I said, that the program doesnt start. That is not true. Only saving causes this error. Because of the saving errors, an earlier version of the program is started, but without errors. When I try to make a bytearray out of the zip, it causes an error (initial content not found), but I suppose the zip doesnt load, so this is not unusual.


Solution

  • you should NOT embed this ZIP but load it instead, you can add to the AIR package any files/folders.

    To do it:

    • in Flash IDE go to "AIR for Android Settings" or "AIR for iOS Settings" and at the bottom of the dialogue box you have "Included files:" field then add folder or file you need,
    • for FlashDevelop what ever will be in bin folder will be packaged in air as described here
    • In Flex it will be the src folder and in the export wizzard you can select which files to include like described here.

    Edit also you should consider for very large files following idea:

    don't include big files (or just basic elements) and download big files and save on user device e.g. on sdcard, and then load it from there.

    best regards