Flagstone Software

AN-001. Classes Supported In Each Version Of Flash.

Each of the data structures which are part of the Flash File Format Specification, published by Macromedia are mapped to a given class in the Transform SWF framework. With each new version of Flash, Macromedia adds new data structures to support new functionality in the Flash Player. When generating files using Transform it is important that only the classes compatible with a given Flash version are used to encode the Flash file.

Flash is forwards compatible. File generated for a given version of Flash will always be played correctly by future versions of the Flash Player. Flash has limited backwards compatibility however. If the Flash Player decodes a file generated using a later version of Flash the behaviour is undefined. At best the Player may ignore the tag leading to unpredictable results when the movie is played or at worst the Player may crash. In either case the person viewing the file is going to be disappointed.

The following table lists the classes in Transform and which version of Flash they are compatible with. Only Flash versions 5 onwards are considered, (SWF6 = Flash MX, SWF7 = Flash MX 2004). Most of the classes are supported in each version. The majority of the differences between each version can be found in the stack-based actions which are executed by the Flash Player to control how a movie is played.

ClassSWF5SWF6SWF7Description
Basic Data Types
FSBoundsDefines the bounding rectangle that encloses an object.
FSColorDefines the colour of an object.
FSColorTransformChanges the colour of an object without changing the original definition.
FSCoordTransformChanges the size, orientation etc. of an object without changing the original definition.
FSNullDefines a null value that will be pushed onto the Flash Player's Stack.
FSVoidDefines a void value that will be pushed onto the Flash Player's Stack.
FSRegisterVariableUse with the FSNewFunction2 class to map arguments to internal registers.
Drawing Shapes
FSShapeDefines the outline of a shape using FSShapeStyle, FSCurve and FSLine objects.
FSShapeStyleSelects line and fill styles and perform absolute moves.
FSCurveDefines a quadratic Bezier curve.
FSLineDefines a line segment.
Line and Fill Styles
FSLineStyleAbstract root class for line styles.
FSSolidLineDefines the colour and thickness of lines.
FSFillStyleAbstract root class for fill styles.
FSSolidFillDefines the colour used to fill shapes.
FSBitmapFillUsed to display images and tile images across a shape.
FSGradientFillDefines a colour gradients used to fill shapes.
FSGradientDefines a transition in a colour gradient.
FSDefineShapeDefines how a shape is drawn and filled.
FSDefineShape2Defines how a shape is drawn and filled, with more than 256 line and fill styles.
FSDefineShape3Defines a transparent shape.
FSMorphSolidLineDefines the colour and thickness of lines used to draw a morphing shape.
FSMorphSolidFillDefines the colour used to fill a morphing shape.
FSMorphBitmapFillUsed to display images and tile images across a morphing shape.
FSMorphGradientFillDefines a colour gradients used to fill a morphing shape.
FSMorphGradientDefines a transition in a colour gradient in a morphing.
FSDefineMorphShapeDefines a morphing shape.
Displaying Images
FSJPEGEncodingTableDefines the encoding table for JPEG images.
FSDefineJPEGImageDefines a JPEG encoded image.
FSDefineJPEGImage2Defines a JPEG encoded image with its own encoding table.
FSDefineJPEGImage3Defines a transparent JPEG encoded image.
FSDefineImageDefines a bit-mapped image.
FSDefineImage2Defines a transparent bitmapped image.
Display List
FSPlaceObjectAdds a shape or button to the display list.
FSPlaceObject2Adds a shape, button, morphing shape or movie clip to the display list.
FSRemoveObjectRemoves an object from the display list.
FSRemoveObject2Simplifies how an object is removed from the display list.
FSShowFrameDisplays all the objects currently in the display list.
Movie Control
FSSetBackgroundColorSets the background colour for a movie.
FSProtectIndicates a movie is only readable by the Flash Player.
FSFrameLabelAssigns a label to a frame in the movie.
FSFreeDeletes an object from a movie.
FSDefineMovieClipDefines a movie clip or sprite.
FSQuicktimeMovieLoads a Quicktime movie.
FSSerialNumberDefines an arbitrary serial number of a movie.
FSPathsArePostscriptThe definitions for the glyphs in a font were derived from a PostScript font file - rarely used, if ever.
FSPointerDefine a pointer - rarely used, if ever.
FSClipEventDefine the events a movie clip responds to.
FSEnableDebuggerEnable a movie to be debugged.
FSExportExport objects from a movie.
FSImportImport objects into a movie.
FSEnableDebugger2Enable a movie to be debugged - the internal format changed in Flash 6.
FSInitializeInitialize a movie clip before it is displayed for the first time.
FSTabOrderAssigns a tab-order for objects that accept user-input.
FSLimitScriptLimits the system resources available to actions - improves reliability and performance.
Buttons
FSDefineButtonDefines a button that executes a set of actions when clicked.
FSButtonIdentifies the shape drawn for a given button state.
FSButtonColorTransformDefine a colour transform to change the colour of a button.
FSButtonSoundIdentify an event sound to be played when a button is clicked.
FSDefineButton2Extends a button definition to execute actions in response to different events.
FSButtonEventDefines an event a button responds to.
Fonts
FSDefineFontDefines the glyphs for each character in a font.
FSFontInfoDefines font information and maps character codes to glyphs.
FSFontInfo2Extends FSFontInfo to add support for small fonts and language dependent line breaks.
FSDefineFont2Combines FSDefineFont and FSFontInfo into a single class.
FSKerningDefines the kerning information for a pair of glyphs.
Text
FSCharacterSelects the glyph displayed for a character.
FSTextDisplays lines of characters along with style information.
FSDefineTextDefines a block of text.
FSDefineText2Defines a block of transparent text.
FSDefineTextFieldDefine an editable text field.
Sounds
FSDefineSoundDefines the sound played when an event occurs.
FSEnvelopeDefine the sound level for a point in a sound envelope.
FSSoundControls how a sound is played.
FSStartSoundStarts and stops an event sound.
FSSoundStreamHeadDefines the transmission and playback information for a streaming sound.
FSSoundStreamHead2Extends a streaming sound to support MP3 encoded sounds.
FSSoundStreamBlockContains the streaming sound played in each frame.

Actions

Flash supports are rich programming model with a comprehensive set of actions which can be used to control how a movie or movie clip is played. A comprehensive set of operators are also available to perform a wide variety of operations and general programming within the environment of the Flash Player.

ClassSWF5SWF6SWF7Description
FSActionClass used to represent byte-code actions in Transform.
FSDoActionDefines a set of actions executed when the display list is updated.
FSGetUrlLoad a Flash file or web page.
FSGetUrl2Load a Flash file, web page or data or submit a form.
FSGotoFrameGoto a specified frame in the movie timeline.
FSGotoLabelGoto the frame in the movie timeline with the specified label.
FSGotoFrame2Combines FSGotoFrame and FSGotoLabel in a single class.
FSSetTargetExecute actions for a movie clip.
FSWaitForFrameExecute actions when a specified frame has been loaded.
FSWaitForFrame2Simplified version of FSWaitForFrame.
FSCallExecute the actions associated with a given frame.
FSIfConditional Branch.
FSJumpUnconditional Branch.
FSPushPush a value onto the Stack.
FSRegisterCopyCopy a value from the Stack to an internal register.
FSRegisterIndexCopy a value from an internal register to the Stack.
FSTableDefine a table for string literals.
FSTableIndexPlace a string from the table of literals on the Stack.
FSNewFunctionDefine a function.
FSWithExecute actions for a movie clip - replaces FSSetTarget.
FSNewFunction2Define a function - optimized for speed of execution.
FSExceptionHandlerDefines a try/catch block for handling exceptions.

Byte-Code Actions

Flash 1 (supported in the Evaluation Edition) initially supported only a few byte-code actions. The addition of a Stack-based programming model for the Flash Player in Flash 4 allowed the actions supported to be greatly expanded with a minimum of complexity. Flash 5 saw the expansion of Macromedia's ActionScript language to support a wide range of operations. The language was modelled on JavaScript and a wide range of data types and operators were added to support the new functionality.

Flash 6 added only a few actions - tidying up some loose ends. A greater than operator was finally added for numbers and strings - previously the operations had to be synthesised using the Less and StringLess byte-codes.

Flash 7 introduced ActionScript 2.0 which greatly increased the level of support for objects. The language is now closer to Java in its syntax and programming model. Several byte-codes were added to support new keywords added to the ActionScript language.

ClassSWF5SWF6SWF7Description
NextFrameGo to the next frame in the movie.
PlayStart playing the movie at the current frame.
PrevFrameGo to the previous frame in the movie.
StopStop playing the movie.
StopSoundsStop playing all sounds.
ToggleQualityToggle the quality of the movie - lower quality improves performance.
And Logical AND two values from the Stack.
AsciiToCharConvert the ASCII code on the Stack to a single character string.
CharToAsciiConvert the first character of the string on the Stack to its ASCII code.
CloneSpriteDuplicate a movie clip.
DivideInteger division.
EndDragStop dragging a movie clip.
GetPropertyPush the value of the specified property onto the Stack.
GetTimePush the number of milliseconds that have elapsed since the movie started onto the Stack.
GetVariablePush the value of a variable onto the Stack.
IntegerAddAdd two integer values from the Stack.
IntegerEqualsAre the two integer values on the Stack equal.
IntegerLessCompare two integer values on the Stack.
MBAsciiToCharConvert a Unicode value to the a single character string.
MBCharToAsciiConvert the first character of string to its Unicode value.
MBStringExtractUnicode substring.
MBStringLengthUnicode string length.
MultiplyMultiply two values on the Stack.
Not Logical NOT of the value on the Stack.
Or Logical OR two values from the Stack.
Pop Pop a value from the Stack.
RandomNumberPush a random number onto the Stack.
RemoveSpriteDelete the specified movie clip.
SetPropertySet the specified property.
SetTarget2Execute the following actions using the specified movie clip.
SetVariableSet the value of a variable.
StartDragStart dragging the specified movie clip.
StringAddConcatenate two strings on the Stack.
StringEqualsCompare two strings on the Stack to see if they are equal.
StringExtractSubstring.
StringLengthString length.
StringLessCompare two Strings on the Stack.
SubtractSubtract two integers on the Stack.
ToIntegerConvert the string on the Stack to its integer representation.
TracePrint value in the Flash console.
Add Add two values on the Stack.
ArithmeticShiftRightPerform an arithmetic shift right.
BitwiseAndPerform a bitwise-AND on two values on the Stack.
BitwiseOrPerform a bitwise-OR on two values on the Stack.
BitwiseXOrPerform a bitwise-Exclusive-OR on two values on the Stack.
DecrementDecrease the value on the Stack by one.
DeleteDelete the object referenced on the Stack.
DeleteVariableDelete the variable referenced on the Stack.
DuplicateDuplicate the value on the Stack.
EnumerateEnumerate through the attributes of the object on the Stack.
EqualsAre the values on the Stack equal.
ExecuteFunctionExecute a function.
ExecuteMethodExecute a method.
GetAttributePush the attribute of an object on the Stack.
GetTargetReturns a string representing the path to the specified movie clip.
GetTypeReturns the type of the object on the Stack.
IncrementIncrement the value on the Stack by one.
InitVariableInitialize a variable.
LessCompare the two values on the Stack.
LogicalShiftLeftPerform an logical shift left.
LogicalShiftRightPerform an logical shift right.
ModuloPush the modulus of two values onto the Stack.
NamedObjectPush one of Flash's built-in objects onto the Stack.
NewArrayDefine an array.
NewMethodDefine a method for an object.
NewObjectDefine an object.
NewVariableDefine a variable.
ReturnReturn from a function or method.
SetAttributeSet the attribute of an object.
SwapSwap the two values on the Stack.
ToNumberConvert the string on the Stack to its numerical equivalent.
ToStringConvert a number on the Stack to its string representation.
EnumerateObjectEnumerate through an objects attributes.
Greater Compare two values on the Stack.
InstanceOfCheck the type of an object.
StrictEqualsCompare two values on the Stack to see if they are the same type and equal.
StringGreaterCompare two strings on the Stack.
CastCasts the type of an object in ActionScript 2.0.
ExtendsExecutes the 'extends' keyword for ActionScript 2.0.
ImplementsExecutes the 'implements' keyword for ActionScript 2.0.
ThrowThrow an exception using the object on the Stack.