Table of Contents

What's New in Flash MX ActionScript

ActionScript evolved tremendously from Flash 5 to Flash MX (as the authoring tool is known) and the corresponding Flash Player 6, and this book has evolved along with it. See Table P-2 in this Preface for details on the Flash version naming conventions.

To preview many of the new features in action, visit:

http://www.moock.org/webdesign/lectures/newInMX

Table P-1 provides a high-level overview of the major additions to ActionScript and tells you where to find more information about each new topic in this book. Unless otherwise stated, cross-references are to Part II, the Language Reference.

Table P-1. New features in Flash MX ActionScript

Feature

For details, see...

Drawing API: draw strokes, shapes, and fills at runtime using new MovieClip methods

MovieClip.beginFill( ), MovieClip.beginGradientFill( ), MovieClip.clear( ), MovieClip.curveTo( ), MovieClip.endFill( ), MovieClip.lineStyle( ), MovieClip.lineTo( ), MovieClip.moveTo( ); Section 13.8 in Chapter 13

Load JPEG-format images at runtime

MovieClip.loadMovie( ), loadMovie( )

Load MP3-format sounds at runtime

Sound.loadSound( )

Check the length of a sound and the amount of time it has been playing

Sound.position, Sound.duration

Detect when a sound finishes playing

Sound.onSoundComplete( )

Create, manipulate, and format text fields at runtime

The TextField class, the TextFormat class, MovieClip.createTextField( )

Mask or unmask a movie clip at runtime

MovieClip.setMask( )

Create movie clips from scratch at runtime

MovieClip.createEmptyMovieClip( )

Determine a movie clip's depth at runtime

MovieClip.getDepth( )

Execute a function or method periodically

setInterval( ), clearInterval( )

Manipulate XML, string, and array data faster due to Flash Player performance improvements

The XML class, the String class, the Array class

Store data locally (much like JavaScript cookies)

The SharedObject object

Create packaged code modules with MovieClip subclasses and components

#initclip, #endinitclip, Object.registerClass( ), attachMovie( ); Chapter 14

Communicate between two Flash Players on the same computer

The LocalConnection class

Declare global variables

_global; Section 5.3 in Chapter 2

Use international characters in the Unicode character set

Section 4.5 in Chapter 4, Appendix C

Define event handlers on movie clips using callback functions

Chapter 10

Use event listeners to respond to events from any object

Chapter 10 and Key.addListener( ), Mouse.addListener( ), Stage.addListener( ), Selection.addListener( ), TextField.addListener( )

Add button behavior to a movie clip

Section 13.9 in Chapter 13

Control button objects at runtime

The Button class

Make content accessible to screen readers for the visually impaired

The Accessibility object

Check the movie width and height at runtime, and reposition movie elements when the movie is resized

Stage.height, Stage.width, Stage.onResize( )

Use lexical and nested function scope, or execute a function as a method of an arbitrary object

Function.call( ), Function.apply( ); Section 2.5.7 in Chapter 2; Section 9.7 in Chapter 9

Access Player and system information such as screen resolution, operating system, and current language

The Capabilities object

Capture keyboard and mouse input events with a centralized input API

The Key object, the Mouse object

Load variables using an intuitive variable loading class rather than the loadVariables( ) function

The LoadVars class

Monitor the download progress of XML or loading variables

XML.getBytesLoaded( ), LoadVars.getBytesLoaded( )

Control the tab order for buttons, text fields, and movie clips

TextField.tabIndex, Button.tabIndex, MovieClip.tabIndex

Turn off the hand cursor for buttons

Button.useHandCursor, MovieClip.useHandCursor

Add getter/setter properties to an object, and receive notification when a property changes

Object.addProperty( ), Object.watch( )


Table of Contents