Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 18

Programming actionscript 3.0
Table of Contents

Advertisement

ECMAScript for XML (E4X)
ActionScript 3.0 implements ECMAScript for XML (E4X), recently standardized as ECMA-
357. E4X offers a natural, fluent set of language constructs for manipulating XML. In
contrast to traditional XML-parsing APIs, XML with E4X performs like a native data type of
the language. E4X streamlines the development of applications that manipulate XML by
drastically reducing the amount of code needed. For more information about the ActionScript
3.0 implementation of E4X, see
Chapter 11, "Working with XML," on page
311.
To view ECMA's E4X specification, go to
www.ecma-international.org/publications/files/
ECMA-ST/ECMA-357.pdf
.
Regular expressions
ActionScript 3.0 includes native support for regular expressions so that you can quickly search
for and manipulate strings. ActionScript 3.0 implements support for regular expressions as
they are defined in the ECMAScript edition 3 language specification (ECMA-262).
Namespaces
Namespaces are similar to the traditional access specifiers used to control visibility of
declarations (
,
,
). They work as custom access specifiers, which
public
private
protected
can have names of your choice. Namespaces are outfitted with a Universal Resource Identifier
(URI) to avoid collisions, and are also used to represent XML namespaces when you work
with E4X.
New primitive types
ActionScript 2.0 has a single numeric type, Number, a double-precision, floating point
number. ActionScript 3.0 contains the int and uint types. The int type is a 32-bit signed
integer that lets ActionScript code take advantage of the fast integer math capabilities of the
CPU. The int type is useful for loop counters and variables where integers are used. The uint
type is an unsigned, 32-bit integer type that is useful for RGB color values, byte counts, and
more.
Flash Player API features
The Flash Player API in ActionScript 3.0 contains many new classes that allow you to control
objects at a low level. The architecture of the language is completely new and more intuitive.
While there are too many new classes to cover in detail here, the following sections highlight
some significant changes.
18
Introduction to ActionScript 3.0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents