Understanding the ActionScript Language > Using Flash MX ActionScript with older versions of Flash > Using Flash MX to open Flash 4 files |
![]() ![]() ![]() |
Using Flash MX 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 Flash 5 and Flash MX, 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 |
![]() |
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 Flash MX, they behave differently depending on the data types of the operands. To prevent any semantic differences in imported files, the |
|
![]() |
In Flash 4, the escape sequence |
![]() |
The |
![]() |
Many functions in Flash 4 did not require closing parentheses, for example, |
![]() |
In Flash 5 and Flash MX, when the |
getProperty("clip", _width) == 0 Number(getProperty("clip", _width)) == Number(0) |
Note: If you used any Flash 5 or Flash MX keywords as variable names in your Flash 4 ActionScript, the syntax returns an error in Flash MX. To fix this, rename your variables in all locations. See Keywords.
![]() ![]() ![]() |