( Code )

JavaSWF9 is a collection of Java classes useful to manipulate SWF files up to version 9.

This work is in progress. The repository is hosted at Google Code and if you want to contribute just let me know.

There’s an early version of the documentation, also available for download.

USAGE EXAMPLES

A. BUILD SWF FROM IMAGE

In this example we have a set of images stored in a local folder. We can build a SWF movie simply calling SWF9.makePNGs if no output compression is required, or SWF9.makeJPEG2s to create a compressed movie, as follow:

import swf9.*; SWF9 swf = new SWF9();swf.makePNGs("folder", "image", "320x240", 25, "out.swf");

The previous snippet create the SWF 9 uncompressed movieclip “out.swf” starting from the image sequence “image001.*, image002.*, etc.” (so the common identifier is “image”) stored in the subfolder “folder”. The framerate will be 25fps and the framesize 320x240px.

import swf9.*; SWF9 swf = new SWF9();swf.makeJPEG2s("folder", "image", "320x240", 25, "out.swf");

The previous snippet create the SWF 9 compressed movieclip “out.swf” starting from the image sequence “image001.*, image002.*, etc.” (so the common identifier is “image”) stored in the subfolder “folder”. The framerate will be 25fps and the framesize 320x240px.

B. MAKE A THUMBNAIL OF THE SWF

Suppose we have a SWF movie and for some reason we want to create the associated thumbnail.

import swf9.*; SWF9 swf = new SWF9("in.swf");swf.makeTHUMB("thumb.png", 10);

The previous snippet create a thumbnail of the SWF 9 movieclip “in.swf” and save it as “thumb.png”. The thumbnail contains the frame number 10 of the clip.

DOWNLOAD

The library package can be downloaded from Google Code

6 Comments

  1. Tony @ UK Hosting

    An interesting java library. What else does the library is capable of aside from the example you gave? Do you have a full documentation of the library?

  2. yeah, it’s missing a documentaton. The wiki in the google code link is empty

  3. They might provide the library in due time. We should probably wait. Was waiting for it too since I’m interested with the library.

  4. it is very interesting for me
    You have exceeded the swf version 8 would be great

  5. Pingback: Extract Files from SWF (Flash) file

  6. It is really very nice examples.
    Is there any codes how to get back each component of SWF file? It is just opposite action of above example (1st example).

Leave a Reply

Recent