User Guide
320 Appendix D: Writing Scripts for Earlier Versions of Flash Player
Using Flash MX 2004 to create content for Flash Player 4
To use Flash MX 2004 to create content for Flash Player 4, specify Flash Player 4 on the Flash tab
of the Publish Settings dialog box (File > Publish Settings).
Flash Player 4 ActionScript has only one basic primitive data type, which is used for numeric and
string manipulation. When you write an application for Flash Player 4, you must use the
deprecated string operators located in the Deprecated > Operators category in the
Actions toolbox.
You can use the following Flash MX 2004 features when you publish for Flash Player 4:
• The array and object access operator ([])
• The dot operator (.)
• Logical operators, assignment operators, and pre- and post-increment/decrement operators
• The modulo operator (%) and all methods and properties of the Math class
The following language elements are not supported natively by Flash Player 4. Flash MX 2004
exports them as series approximations, which creates results that are less numerically accurate. In
addition, because of the inclusion of series approximations in the SWF file, these language
elements need more room in Flash Player 4 SWF files than they do in Flash Player 5 or later SWF
files.
• The for, while, do..while, break, and continue actions
• The print() and printAsBitmap() actions
• The switch action
For additional information, see “About targeting older versions of Flash Player” on page 319.
Using Flash MX 2004 to open Flash 4 files
Flash 4 ActionScript had only one true data type: string. It used different types of operators in
expressions to indicate whether the value should be treated as a string or as a number. In
subsequent releases of Flash, you can use one set of operators on all data types.
When you use Flash 5 or later to open a file that was created in Flash 4, Flash automatically
converts ActionScript expressions to make them compatible with the new syntax. Flash makes the
following data type and operator conversions:
• The = operator in Flash 4 was used for numeric equality. In Flash 5 and later, == is the equality
operator and
= is the assignment operator. Any = operators in Flash 4 files are automatically
converted to
==.
• Flash automatically performs type conversions to ensure that operators behave as expected.
Because of the introduction of multiple data types, the following operators have new
meanings:
+, ==, !=, <>, <, >, >=, <=