Starting to work with an API like JSwiff can be pretty hard. There is a multitude of API classes and you have no idea which one you need for your purposes. Some simple tutorials can be of great help at the beginning; even though they rarely explain exactly what you need to do, in many cases they show you the right direction.
Two methods are common to all JSwiff tutorials. The main method calls
createDocument, which is responsible for
the SWF document creation (thus being different in each tutorial), and
writeDocument, which writes the document to a SWF file.
public static void main(String[] args) {
String fileName = "tutorial.swf";
SWFDocument document = createDocument();
try {
writeDocument(document, fileName);
} catch (IOException e) {
System.out.println("An error occured while writing " + fileName + ":");
e.printStackTrace();
}
}
private static void writeDocument(SWFDocument document, String fileName)
throws IOException {
SWFWriter writer = new SWFWriter(document, new FileOutputStream(fileName));
writer.write();
}
Generate a simple SWF file containing colored text - a tiny step towards dynamic Flash generation.
... are being developed