Mmexecute() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

MMExecute()

Availability
Flash Player 7.
Usage
MMExecute("Flash JavaScript API command;":String)
Parameters
Flash JavaScript API command
(JSFL) file.
Returns
A string representation of the result, if any, sent by the JavaScript statement.
Description
Function; lets you issue Flash JavaScript API (JSAPI) commands from ActionScript. In Flash
MX2004 the
MMExecute
is stored in WindowSWF directory), by an XMLtoUI dialog box, or by the Custom UI of a
component. JSAPI commands have no effect in the player, in test movie mode, or outside the
authoring environment.
The Flash JSAPI provides several objects, methods, and properties to duplicate or emulate
commands that a user can enter in the authoring environment. Using the JSAPI, you can write
scripts that extend Flash in several ways: adding commands to menus, manipulating objects on
the Stage, repeating sequences of commands, and so on.
In general, a user runs a JSAPI script by selecting Commands > Run Command. However, you
can use this function in an ActionScript script to call a JSAPI command directly. If you use
in a script on Frame 1 of your file, the command executes when the SWF file
MMExecute()
is loaded.
For more information on the JSAPI, see www.macromedia.com/go/jsapi_info_en.
Example
The following command will output the number of items in the library of the current document
to the trace window. You must run this example as a Flash panel because Flash files can't call
if they are run in either test movie or the browser.
MMExecute
Place the following code into frame 1 of the main Timeline of an empty Flash document:
var numLibItems = MMExecute("fl.getDocumentDOM().library.items.length");
var message = numLibItems + " items in library";
MMExecute('fl.trace("' + message + '");');
Save the FLA file in the WindowSWF directory that is located in your Configuration directory,
and then select File > Publish (or save it elsewhere and either publish the SWF file directly to
that directory, or move the SWF file to that directory).
Quit and restart the application (you need to do this step the first time you add your file to the
WindowSWF directory).
ActionScript Language Reference
Any command that you can use in a Flash JavaScript
function can be called only by a movie that is used as a Flash Panel (file
CHAPTER 2
MMExecute()
473

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents