New and changed ActionScript 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 is displayed when a user right-clicks (Microsoft 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.
- (Windows only) The
Mouse.onMouseWheel
event listener is generated when the user scrolls using the mouse wheel.
- 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 being loaded into movie clips.
- The NetConnection class and NetStream class let you stream local video files (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.
- The
TextField.condenseWhite
property lets you remove extra white space from HTML text fields that are rendered in a browser.
- The
TextField.mouseWheelEnabled
property lets you specify whether a text field's contents should scroll when the mouse pointer is positioned over a text field and the user rolls the mouse wheel.
- The TextField.StyleSheet class lets you create a style sheet object that contains text formatting rules such as font size, color, and other formatting styles.
- The
TextField.styleSheet
property lets you attach a style sheet object to a text field.
- The
TextFormat.getTextExtent()
method accepts a new parameter, and the object it returns contains a new member.
- The
XML.addRequestHeader()
method lets you add or change HTTP request headers (such as Content-Type
or SOAPAction
) sent with POST
actions.