Flagstone Software

Example Code

These examples illustrate how to use the classes from the com.flagstone.transfrom and com.flagstone.transform.util packages in the framework. Each example generates a working Flash file that can be viewed using the stand-alone Flash player or web browser plug-in.

com.flagstone.transform

The classes in this package provide the basic API for reading and writing Flash files. The examples here cover all the basic concepts used in Flash and provide a guide to start creating movies.

Example Description
Example.java Abstract parent class that contains the methods common to all the examples.
MovieBasics.java Shows some of the basic objects used to create a movie.
DrawingShapes.java Shows how to use the FSDefineShape class to draw shapes.
LineStyles.java Shows how to set the style when drawing lines using the FSSolidLine class.
FillStyles.java shows how the different fill styles can be used to fill a shape.
DisplayList.java Illustrates how to use the classes that update and change the Flash Player's display list.
Transforms.java Illustrates the different coordinate and colour transforms that can be applied to an object to change its appearance without changing the original definition.

com.flagstone.transform.util

The classes in com.flagstone.transform.util simplify adding images, text and sounds to a movie.

Example Description
BasicShapes.java Shows how to use the FSShapeConstructor class to create geometric and arbitrary complex shapes.
BasisSounds.java Use the FSSoundConstructor to play WAVE and MP3 encoded sounds.
BasicButtons.java Shows how to use the FSShapeConstructor and FSSoundConstructor to create buttons.
ShowFont.java Display all the characters defined in a TrueType font.
ShowAWTFonts.java Shows all the characters in each of the fonts available in the Java AWT toolkit.
ShowImage.java Uses the FSImageConstructor to display a BMP, PNG or JPEG image.
StreamingSounds.java Shows how to stream a sound as a movie is played.

All these examples are distributed as part of the Transform SFW framework. The code can be found in the path src/com/flagstone/transform/examples.