JavaSWF9 – Java for SWF library

1_175x175

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

5 Comments

2 Trackbacks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>