• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part III: Appendixes > Flash 4 Versus Flash 5 (and Later)

C.3. Flash 4 Versus Flash 5 (and Later)

Table C-1 summarizes key backward-compatibility issues and differences between ActionScript in Flash 4 versus Flash 5 and Flash 6.

Table C-1. Flash 4 backward-compatibility issues
Topic Description
Creating variables Flash 4's set function has been replaced by the var statement.
Variable and timeline references The Flash 4-style slash-colon constructions (/square:area) have been superceded by dot notation (square.area).
String comparison operators The Flash 4 string comparison operators—eq, ne, ge, gt, le, lt—have been superceded by the following operators in Flash 5 and later: = =, !=, >=, >, <=, <.
String concatenation operator When creating Flash 4 content in Flash 5 or later, use the add operator instead of Flash 4's & operator. When authoring for Flash 5 or later, use the + operator for string concatenation.
String length Flash 4's length( ) function (e.g., length(myString)) has been superceded by the String.length property (e.g., myString.length).
Substring extraction Flash 4's substring( ) function (e.g., substring(myString, 1, 3)) has been superceded by the substring( ), substr( ), and slice( ) methods. Note that substring( ) differs in Flash 4 and Flash 5.
Character code point functions Flash 4's chr( ) and mbchr( ) functions (used to create a character from a code point) have been superceded by String.fromCharCode( ). Flash 4's ord( ) and mbord( ) functions (used to determine the code point of a character) have been superceded by String.charCodeAt( ).
Datatype conversion When importing Flash 4 files, Flash 5 and Flash MX automatically insert the Number( ) function around any numeric data that is used as an operand of the following potentially ambiguous operators: +, = =, !=, <>, <, >, >=, <=.
The ifFrameLoaded statement Flash 3's ifFrameLoaded statement is deprecated. Use the _totalframes and _framesloaded MovieClip properties to create preloading code.
Infinite loops Flash 4 allowed a maximum of 200,000 loop iterations. Flash 5 and Flash 6 allow 15 seconds for loops, after which they warn users that the movie has stopped responding. See Section 8.6.3.
Subroutines versus functions In Flash 4, a subroutine could be created by attaching a block of code to a frame with a label and executing it using the call( ) statement. In Flash 5 and later, functions replace Flash 4 subroutines.
Clip events Flash 4 supported only button events (i.e., functions starting with on( )). For modern event-handling techniques, see Chapter 10.
Capturing keystrokes In Flash 4, keyPress was the only means of capturing keystrokes. In Flash 5 and later, the Key object and the movie clip events onClipEvent(keyDown) and onClipEvent(keyUp) offer much greater control over keyboard interaction.
Tell Target deprecated Flash 4's Tell Target action (used to control remote movie clips) is replaced by properties and methods accessed using dot notation and the with statement. See "Whither Tell Target" later in this appendix.
Get Property deprecated Flash 4's Get Property command is no longer required for movie clip property access. Use the dot operator instead. See Chapter 13.
int deprecated Flash 4's int( ) function (used to truncate floats to integers) has been superceded by Math.floor( ), Math.ceil( ), and Math.round( ).
Random number generation Flash 4's random( ) function (used to generate a random number) has been superceded by Math.random( ).
Toggle High Quality deprecated Flash 4's Toggle High Quality action (used to set the rendering quality of the player) has been superceded by the global _quality property.
_highquality deprecated Flash 4's _highquality property has been superceded by the global _quality property.
Math object support in Flash 4 The functions and properties of the Math object (e.g., Math.cos( ), Math.PI ) are not natively supported by Flash Player 4. The values, however, are approximated when a movie is exported in Flash 4 format.
loadMovie versus loadMovieNum Flash 3's loadMovie( ) onto a numbered level is superceded by loadMovieNum( ) (which accepts an integer level argument) as of Flash 5. Flash 4's loadMovie( ) into a target movie clip is still available as loadMovie( ) in Flash 5 and later.
Printing Flash 5 and later support native print functions, which are available in Flash and later as a modified Get URL action only.
Objects and classes not supported Flash 4 does not support any of Flash 5's or Flash 6's built-in objects and classes (with the exception of Math as noted earlier in this table).



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint