78
ActionScript language elements
Availability:
ActionScript 1.0; Flash Player 7
Parameters
command
:String
- Any command that you can use in a Flash JavaScript (JSFL) file.
Returns
String
- A string representation of the result, if any, sent by the JavaScript statement.
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
MMExecute
if they are run in either test movie or the browser.
■
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 = numLi " items in library";
MMExecute('fl.trace("' + m '");');
■
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).
Now you can select your file from the bottom of the Window > Other Panels menu.
The ActionScript trace function does not work from a Flash panel; this example uses the
JavaScript
fl.trace
version to get the output. It might be easier to copy the results of
MMExecute
to a text field that is part of your Flash Panel file.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...