O'Reilly logo

ActionScript: The Definitive Guide by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. Backward Compatibility

Flash allows you to publish .swf files in a format that is compatible with previous versions of the Player. By the time you read this, the majority of users will have at least version 5 of the Flash plug-in, but you may prefer to author for the Flash 4 plug-in instead. Even if you are authoring exclusively for Flash 5, this appendix will help you avoid using deprecated ActionScript and bring you up to speed on the preferred methods in Flash 5. For statistics on the distribution of various Flash Player versions, see:

http://www.macromedia.com/software/flash/survey/whitepaper

When authoring for Flash 4, use the deprecated techniques (i.e., those that are outdated, but supported for backward compatibility) listed in Table 3.1. See also “Using Flash 5 to Create Flash 4 Content” under “Writing Scripts with ActionScript” in Macromedia’s Flash ActionScript Reference Guide.

Warning

To run scripts in the Flash 4 Player you must set the Version of your .swf file to Flash 4 under the Flash tab under File Publish Settings. All code is disabled if you attempt to run a Flash 5 or later .swf file in the Flash 4 Player.

Table 3.1 summarizes key backward-compatibility issues and differences between Flash 4 ActionScript and Flash 5 ActionScript.

Table C-1. Backward-Compatibility Issues

Topic

Description

Creating variables

Flash 4’s set function has been replaced by the var statement. To create dynamically named variables, use eval( ), or (more appropriately) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required