User Guide
12 Chapter 1: What’s New in Flash MX 2004 ActionScript
New and changed language elements
This section describes the ActionScript language elements that are new or changed in Flash MX
2004. To use any of these elements in your scripts, you must target Flash Player 7 (the default)
when you publish your documents.
• The Array.sort() and Array.sortOn() methods let you add parameters to specify
additional sorting options, such as ascending and descending sorting, whether to consider case-
sensitivity when sorting, and so on.
• The Button.menu, MovieClip.menu, and TextField.menu properties work with the new
ContextMenu and ContextMenuItem classes to let you associate context menu items with
Button, MovieClip, or TextField objects.
• The “ContextMenu class” and “ContextMenuItem class” let you customize the context menu
that appears when a user right-clicks (Windows) or Control-clicks (Macintosh) in Flash Player.
• The “Error class” and the throw and try..catch..finally commands let you implement
more robust exception handling.
• The LoadVars.addRequestHeader() and XML.addRequestHeader() methods add or change
HTTP request headers (such as
Content-Type or SOAPAction) sent with POST actions.
• The MMExecute() function lets you issue Flash JavaScript API commands from ActionScript.
• The Mouse.onMouseWheel event listener is generated when the user scrolls using the mouse
wheel (Windows only).
• The MovieClip.getNextHighestDepth() method lets you create MovieClip instances at
runtime and be guaranteed that their objects render in front of the other objects in a parent
movie clip’s z-order space.
• The MovieClip.getInstanceAtDepth() method lets you access dynamically created
MovieClip instances using the depth as a search index.
• The MovieClip.getSWFVersion() method lets you determine which version of Flash Player
is supported by a loaded SWF file.
• The MovieClip.getTextSnapshot() method and the “TextSnapshot object” let you work
with text that is in static text fields in a movie clip.
• The MovieClip._lockroot property lets you specify that a movie clip will act as _root for
any movie clips loaded into it or that the meaning of
_root in a movie clip won’t change if that
movie clip is loaded into another movie clip.
• The “MovieClipLoader class” lets you monitor the progress of files as they are loaded into
movie clips.
• The “NetConnection class” and “NetStream class” let you stream local Flash video (FLV) files.
• The “PrintJob class” gives you (and the user) more control over printing from Flash Player.
• The Sound.onID3 event handler provides access to ID3 data associated with a Sound object
that contains an MP3 file.
• The Sound.id3 property provides access to the metadata that is part of an MP3 file.
• The “System class” has new objects and methods, and the “System.capabilities object” has
several new properties.