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.
| Class | SWF5 | SWF6 | SWF7 | Description | |
|---|---|---|---|---|---|
| Basic Data Types | |||||
| FSBounds | Defines the bounding rectangle that encloses an object. | ||||
| FSColor | Defines the colour of an object. | ||||
| FSColorTransform | Changes the colour of an object without changing the original definition. | ||||
| FSCoordTransform | Changes the size, orientation etc. of an object without changing the original definition. | ||||
| FSNull | Defines a null value that will be pushed onto the Flash Player's Stack. | ||||
| FSVoid | Defines a void value that will be pushed onto the Flash Player's Stack. | ||||
| FSRegisterVariable | Use with the FSNewFunction2 class to map arguments to internal registers. | ||||
| Drawing Shapes | |||||
| FSShape | Defines the outline of a shape using FSShapeStyle, FSCurve and FSLine objects. | ||||
| FSShapeStyle | Selects line and fill styles and perform absolute moves. | ||||
| FSCurve | Defines a quadratic Bezier curve. | ||||
| FSLine | Defines a line segment. | ||||
| Line and Fill Styles | |||||
| FSLineStyle | Abstract root class for line styles. | ||||
| FSSolidLine | Defines the colour and thickness of lines. | ||||
| FSFillStyle | Abstract root class for fill styles. | ||||
| FSSolidFill | Defines the colour used to fill shapes. | ||||
| FSBitmapFill | Used to display images and tile images across a shape. | ||||
| FSGradientFill | Defines a colour gradients used to fill shapes. | ||||
| FSGradient | Defines a transition in a colour gradient. | ||||
| FSDefineShape | Defines how a shape is drawn and filled. | ||||
| FSDefineShape2 | Defines how a shape is drawn and filled, with more than 256 line and fill styles. | ||||
| FSDefineShape3 | Defines a transparent shape. | ||||
| FSMorphSolidLine | Defines the colour and thickness of lines used to draw a morphing shape. | ||||
| FSMorphSolidFill | Defines the colour used to fill a morphing shape. | ||||
| FSMorphBitmapFill | Used to display images and tile images across a morphing shape. | ||||
| FSMorphGradientFill | Defines a colour gradients used to fill a morphing shape. | ||||
| FSMorphGradient | Defines a transition in a colour gradient in a morphing. | ||||
| FSDefineMorphShape | Defines a morphing shape. | ||||
| Displaying Images | |||||
| FSJPEGEncodingTable | Defines the encoding table for JPEG images. | ||||
| FSDefineJPEGImage | Defines a JPEG encoded image. | ||||
| FSDefineJPEGImage2 | Defines a JPEG encoded image with its own encoding table. | ||||
| FSDefineJPEGImage3 | Defines a transparent JPEG encoded image. | ||||
| FSDefineImage | Defines a bit-mapped image. | ||||
| FSDefineImage2 | Defines a transparent bitmapped image. | ||||
| Display List | |||||
| FSPlaceObject | Adds a shape or button to the display list. | ||||
| FSPlaceObject2 | Adds a shape, button, morphing shape or movie clip to the display list. | ||||
| FSRemoveObject | Removes an object from the display list. | ||||
| FSRemoveObject2 | Simplifies how an object is removed from the display list. | ||||
| FSShowFrame | Displays all the objects currently in the display list. | ||||
| Movie Control | |||||
| FSSetBackgroundColor | Sets the background colour for a movie. | ||||
| FSProtect | Indicates a movie is only readable by the Flash Player. | ||||
| FSFrameLabel | Assigns a label to a frame in the movie. | ||||
| FSFree | Deletes an object from a movie. | ||||
| FSDefineMovieClip | Defines a movie clip or sprite. | ||||
| FSQuicktimeMovie | Loads a Quicktime movie. | ||||
| FSSerialNumber | Defines an arbitrary serial number of a movie. | ||||
| FSPathsArePostscript | The definitions for the glyphs in a font were derived from a PostScript font file - rarely used, if ever. | ||||
| FSPointer | Define a pointer - rarely used, if ever. | ||||
| FSClipEvent | Define the events a movie clip responds to. | ||||
| FSEnableDebugger | Enable a movie to be debugged. | ||||
| FSExport | Export objects from a movie. | ||||
| FSImport | Import objects into a movie. | ||||
| FSEnableDebugger2 | Enable a movie to be debugged - the internal format changed in Flash 6. | ||||
| FSInitialize | Initialize a movie clip before it is displayed for the first time. | ||||
| FSTabOrder | Assigns a tab-order for objects that accept user-input. | ||||
| FSLimitScript | Limits the system resources available to actions - improves reliability and performance. | ||||
| Buttons | |||||
| FSDefineButton | Defines a button that executes a set of actions when clicked. | ||||
| FSButton | Identifies the shape drawn for a given button state. | ||||
| FSButtonColorTransform | Define a colour transform to change the colour of a button. | ||||
| FSButtonSound | Identify an event sound to be played when a button is clicked. | ||||
| FSDefineButton2 | Extends a button definition to execute actions in response to different events. | ||||
| FSButtonEvent | Defines an event a button responds to. | ||||
| Fonts | |||||
| FSDefineFont | Defines the glyphs for each character in a font. | ||||
| FSFontInfo | Defines font information and maps character codes to glyphs. | ||||
| FSFontInfo2 | Extends FSFontInfo to add support for small fonts and language dependent line breaks. | ||||
| FSDefineFont2 | Combines FSDefineFont and FSFontInfo into a single class. | ||||
| FSKerning | Defines the kerning information for a pair of glyphs. | ||||
| Text | |||||
| FSCharacter | Selects the glyph displayed for a character. | ||||
| FSText | Displays lines of characters along with style information. | ||||
| FSDefineText | Defines a block of text. | ||||
| FSDefineText2 | Defines a block of transparent text. | ||||
| FSDefineTextField | Define an editable text field. | ||||
| Sounds | |||||
| FSDefineSound | Defines the sound played when an event occurs. | ||||
| FSEnvelope | Define the sound level for a point in a sound envelope. | ||||
| FSSound | Controls how a sound is played. | ||||
| FSStartSound | Starts and stops an event sound. | ||||
| FSSoundStreamHead | Defines the transmission and playback information for a streaming sound. | ||||
| FSSoundStreamHead2 | Extends a streaming sound to support MP3 encoded sounds. | ||||
| FSSoundStreamBlock | Contains 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.
| Class | SWF5 | SWF6 | SWF7 | Description |
|---|---|---|---|---|
| FSAction | Class used to represent byte-code actions in Transform. | |||
| FSDoAction | Defines a set of actions executed when the display list is updated. | |||
| FSGetUrl | Load a Flash file or web page. | |||
| FSGetUrl2 | Load a Flash file, web page or data or submit a form. | |||
| FSGotoFrame | Goto a specified frame in the movie timeline. | |||
| FSGotoLabel | Goto the frame in the movie timeline with the specified label. | |||
| FSGotoFrame2 | Combines FSGotoFrame and FSGotoLabel in a single class. | |||
| FSSetTarget | Execute actions for a movie clip. | |||
| FSWaitForFrame | Execute actions when a specified frame has been loaded. | |||
| FSWaitForFrame2 | Simplified version of FSWaitForFrame. | |||
| FSCall | Execute the actions associated with a given frame. | |||
| FSIf | Conditional Branch. | |||
| FSJump | Unconditional Branch. | |||
| FSPush | Push a value onto the Stack. | |||
| FSRegisterCopy | Copy a value from the Stack to an internal register. | |||
| FSRegisterIndex | Copy a value from an internal register to the Stack. | |||
| FSTable | Define a table for string literals. | |||
| FSTableIndex | Place a string from the table of literals on the Stack. | |||
| FSNewFunction | Define a function. | |||
| FSWith | Execute actions for a movie clip - replaces FSSetTarget. | |||
| FSNewFunction2 | Define a function - optimized for speed of execution. | |||
| FSExceptionHandler | Defines 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.
| Class | SWF5 | SWF6 | SWF7 | Description |
|---|---|---|---|---|
| NextFrame | Go to the next frame in the movie. | |||
| Play | Start playing the movie at the current frame. | |||
| PrevFrame | Go to the previous frame in the movie. | |||
| Stop | Stop playing the movie. | |||
| StopSounds | Stop playing all sounds. | |||
| ToggleQuality | Toggle the quality of the movie - lower quality improves performance. | |||
| And | Logical AND two values from the Stack. | |||
| AsciiToChar | Convert the ASCII code on the Stack to a single character string. | |||
| CharToAscii | Convert the first character of the string on the Stack to its ASCII code. | |||
| CloneSprite | Duplicate a movie clip. | |||
| Divide | Integer division. | |||
| EndDrag | Stop dragging a movie clip. | |||
| GetProperty | Push the value of the specified property onto the Stack. | |||
| GetTime | Push the number of milliseconds that have elapsed since the movie started onto the Stack. | |||
| GetVariable | Push the value of a variable onto the Stack. | |||
| IntegerAdd | Add two integer values from the Stack. | |||
| IntegerEquals | Are the two integer values on the Stack equal. | |||
| IntegerLess | Compare two integer values on the Stack. | |||
| MBAsciiToChar | Convert a Unicode value to the a single character string. | |||
| MBCharToAscii | Convert the first character of string to its Unicode value. | |||
| MBStringExtract | Unicode substring. | |||
| MBStringLength | Unicode string length. | |||
| Multiply | Multiply 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. | |||
| RandomNumber | Push a random number onto the Stack. | |||
| RemoveSprite | Delete the specified movie clip. | |||
| SetProperty | Set the specified property. | |||
| SetTarget2 | Execute the following actions using the specified movie clip. | |||
| SetVariable | Set the value of a variable. | |||
| StartDrag | Start dragging the specified movie clip. | |||
| StringAdd | Concatenate two strings on the Stack. | |||
| StringEquals | Compare two strings on the Stack to see if they are equal. | |||
| StringExtract | Substring. | |||
| StringLength | String length. | |||
| StringLess | Compare two Strings on the Stack. | |||
| Subtract | Subtract two integers on the Stack. | |||
| ToInteger | Convert the string on the Stack to its integer representation. | |||
| Trace | Print value in the Flash console. | |||
| Add | Add two values on the Stack. | |||
| ArithmeticShiftRight | Perform an arithmetic shift right. | |||
| BitwiseAnd | Perform a bitwise-AND on two values on the Stack. | |||
| BitwiseOr | Perform a bitwise-OR on two values on the Stack. | |||
| BitwiseXOr | Perform a bitwise-Exclusive-OR on two values on the Stack. | |||
| Decrement | Decrease the value on the Stack by one. | |||
| Delete | Delete the object referenced on the Stack. | |||
| DeleteVariable | Delete the variable referenced on the Stack. | |||
| Duplicate | Duplicate the value on the Stack. | |||
| Enumerate | Enumerate through the attributes of the object on the Stack. | |||
| Equals | Are the values on the Stack equal. | |||
| ExecuteFunction | Execute a function. | |||
| ExecuteMethod | Execute a method. | |||
| GetAttribute | Push the attribute of an object on the Stack. | |||
| GetTarget | Returns a string representing the path to the specified movie clip. | |||
| GetType | Returns the type of the object on the Stack. | |||
| Increment | Increment the value on the Stack by one. | |||
| InitVariable | Initialize a variable. | |||
| Less | Compare the two values on the Stack. | |||
| LogicalShiftLeft | Perform an logical shift left. | |||
| LogicalShiftRight | Perform an logical shift right. | |||
| Modulo | Push the modulus of two values onto the Stack. | |||
| NamedObject | Push one of Flash's built-in objects onto the Stack. | |||
| NewArray | Define an array. | |||
| NewMethod | Define a method for an object. | |||
| NewObject | Define an object. | |||
| NewVariable | Define a variable. | |||
| Return | Return from a function or method. | |||
| SetAttribute | Set the attribute of an object. | |||
| Swap | Swap the two values on the Stack. | |||
| ToNumber | Convert the string on the Stack to its numerical equivalent. | |||
| ToString | Convert a number on the Stack to its string representation. | |||
| EnumerateObject | Enumerate through an objects attributes. | |||
| Greater | Compare two values on the Stack. | |||
| InstanceOf | Check the type of an object. | |||
| StrictEquals | Compare two values on the Stack to see if they are the same type and equal. | |||
| StringGreater | Compare two strings on the Stack. | |||
| Cast | Casts the type of an object in ActionScript 2.0. | |||
| Extends | Executes the 'extends' keyword for ActionScript 2.0. | |||
| Implements | Executes the 'implements' keyword for ActionScript 2.0. | |||
| Throw | Throw an exception using the object on the Stack. |