EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Using Flash MX 2004 to Create Content for Flash Player 4

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
796 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 in 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 both numeric
and string manipulation. When you author 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-increment 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 take up 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 795.
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. You’ll see the
following data type and operator conversions in your ActionScript code:
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:
+, ==, !=, <>, <, >, >=, <=
In Flash 4 ActionScript, these operators were always numeric operators. In Flash 5 and later,
they behave differently depending on the data types of the operands. To prevent any semantic
differences in imported files, the
Number() function is inserted around all operands to these
operators. (Constant numbers are already obvious numbers, so they are not enclosed
in
Number()).

Table of Contents

Related product manuals