Overview
This package is intended as a low level wrapper for the SWF binary format (Macromedia Flash 4 Player file format).
It comprises a number of Java classes that can read and write binary SWF, and export/import to/from an XML representation. The wrapper classes can also be programmatically constructed.
Status of this Release
This release has been rushed out to provide a preview, and proof of existence, of the technology - and to provide a focal point for discussion about the future of Java/SWF/XML tools and applications.
The code is still a work in progress and, athough it is functional in its current form, it will require more work in terms of tag coverage and abstraction/robustness to make it a general purpose Java/SWF framework.
A more fully fleshed release package will, hopefully, be available in the second half of May. In the meantime comments and constructive suggestions are welcome. (Documentation is an acknowledged requirement !!)
Tag Coverage
The following types of tags are implemented:
Yet to be implemented:
Caveats
This is a preview release - it is possible that some things will change in the near future - so please be aware of this before building too much code on top of this codebase.
The current set of classes are very close to the metal of the SWF format. The only real abstraction is that frames are represented at a higher level than tags. There is also very little error checking and almost no SWF semantic checking.
This means that a good working knowledge of the SWF format is required in order to use the wrappers to produce meaningful SWF output. Future work will include layering more abstract wrappers on top of this code to make SWF generation more programmer-friendly and robust.
The above remarks also apply to the XML vocabulary that is imported/exported. It is possible to produce IllegalNumberFormat exceptions if certain XML attributes are not valid numbers, etc.
More abstract XML vocabularies will probably also be required to make the framework suitable for a more general XML/XLST audience.
The DefineFont2 and DefineTextField tags were broken at the time of this release and have been omitted.
Licensing
This release is being made under the GNU Public License (GPL) v 2.0 - a copy of which is provided in the package.
Other licensing (such as the Lesser/Library GNU Public License) may be possible in future. In the meantime, other licensing options may be entertained for those who wish to incorporate this technology into commercial products.
Support
No formal support is offered with this release. However, informal dialogue of a technical nature is more than welcome.
Installation
This release is only for programmers ! It is assumed that you can compile the Java source without any further help.
The wrappers have been tested with both JDK 1.1.8 and JDK 1.2. Experimental work with java.util.zip to compress image data indicates a likely dependency on JDK 1.2 for the DefineBitsLossless tag (JDK 1.1.8 GPF's !!).
The X2S.java, S2X.java and SWFTest2.java sample files require SUN's Project X (v2) XML parser - available from SUN. The wrappers themselves only use the W3C DOM Level 1 interfaces, and so should work with any other compliant XML parser - but this has not been tested.
Using the Wrappers - a Minimal Introduction
To convert from SWF to XML use
java S2X file.swf file.xml
To convert from XML to SWF use
java X2S file.xml file.swf
X2S and S2X are provided as examples only. The XML output is not "viewer-friendly" - use IE5 or other XML formatting viewer to examine the results.
Test.java is an example of constructing a SWF programmatically (looks really nasty, doesn't it ?) - requires the name of the output file (.swf) are the only argument. The SWF movie is a yellow square button with a hyperlink action.
SWFTest.java is a testing utility that reads a SWF file (arg 1) and then writes it out again (filename = arg 2). The output is compared byte-for-byte with the input to verify that the wrappers work both ways.
SWFTest2.java is like SWFTest - but it performs an XML export/import in the middle to verify that the XML import functionality works, and results in an identical SWF binary.
Feedback
Email to: d_nick_main@yahoo.com
Futures