The Flash Document Object Model - MACROMEDIA FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY Manual

Flash javascript dictionary
Hide thumbs Also See for FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY:
Table of Contents

Advertisement

You can embed individual JSAPI commands in ActionScript files by using the
MMExecute()
command, which is documented in the Flash MX 2004 ActionScript Language Reference. However,
the
command has an effect only when it is used in the context of a custom user-
MMExecute()
interface element, such as a component Property inspector, or a SWF panel within the authoring
environment. Even if called from ActionScript, JSAPI commands have no effect in Flash Player or
outside the authoring environment.
The JSAPI also contains a number of methods that let you implement extensibility using a
combination of JavaScript and custom C code. For more information, see
Chapter 4, "C-Level
Extensibility," on page
369.
Flash JavaScript objects contain properties and methods. Properties, each defined as a primitive
type such as Boolean, integer, array, float, or reference data types such as color, object, point, rect,
and String, are used to describe the object. Methods are used to perform a function on the object.
To access the properties or methods of an object, dot notation is used. Also, most objects have
and
methods, which get the value for a specified property or set
getProperty()
setProperty()
the value for a specified property. Most methods take parameters that are used to specify different
options for the method.
The JavaScript interpreter in Flash is the Mozilla SpiderMonkey engine, version 1.5, which is
available on the web at http://www.mozilla.org/js/spidermonkey/. SpiderMonkey is one of the
two reference implementations of the JavaScript language developed by Mozilla.org. It is the same
engine that is embedded in the Mozilla browser.
SpiderMonkey implements the entire core JavaScript language as defined in the ECMA-262
specification. It is fully compliant with ECMA-262 Edition 3. Only the browser-specific host
objects, which are not part of the ECMA-262 specification, are not supported.
All "Core JavaScript" sections of Netscape's JavaScript documentation at
http://
devedge.netscape.com/central/javascript/
apply to the Flash JavaScript interpreter. All "Client-
Side JavaScript" sections do not apply because they only apply to browser environments.
SpiderMonkey is also used in Fireworks MX 2004, Dreamweaver MX 2004, Director MX 2004
and Flash Communication Server MX.

The Flash Document Object Model

The DOM for the Flash JavaScript API consists of a set of top-level functions (see
"Top-level
functions" on page
25) and the top-level
flash
object. The
object is guaranteed to be
flash
available to a script because it always exists when the Flash authoring environment is open. When
referring to this object, you can use
or
. For example, to close all open files, you can use
flash
fl
either of the following statements:
flash.closeAll();
fl.closeAll();
The Flash Document Object Model
19

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents