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 (
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
•
The
print()
•
The
action
switch
For additional information, see
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,
=
operator and
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
operators. (Constant numbers are already obvious numbers, so they are not enclosed
in
).
Number()
796
Appendix D: Writing Scripts for Earlier Versions of Flash Player
)
.
), and all methods and properties of the Math class
%
,
,
do..while
break
and
printAsBitmap()
"About targeting older versions of Flash Player" on page
is the assignment operator. Any
=
.
,
,
,
<
>
>=
<=
Number()
)
[]
, and
actions
continue
actions
operators in Flash 4 files are automatically
=
function is inserted around all operands to these
795.
is the equality
==
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?