Global Functions
57
Usage 3: The
fscommand()
function can send messages to Macromedia Director. These
messages are interpreted by Lingo (the Director scripting language) as strings, events, or
executable Lingo code. If a message is a string or an event, you must write the Lingo code to
receive the message from the
fscommand()
function and carry out an action in Director. For
more information, see the Director Support Center at www.macromedia.com/support/
director.
Usage 4: In VisualBasic, Visual C++, and other programs that can host ActiveX controls,
fscommand()
sends a VB event with two strings that can be handled in the environment's
programming language. For more information, use the keywords "Flash method" to search
the Flash Support Center at www.macromedia.com/support/flash.
Note:
If you are publishing for Flash Player 8 or later, the ExternalInterface class provides
better functionality for communication between JavaScript and ActionScript (Usage 2) and
between ActionScript and VisualBasic, Visual C++, or other programs that can host ActiveX
controls (Usage 4). You should continue to use
fscommand()
for sending messages to Flash
Player (Usage 1) and Macromedia Director (Usage 3).
Availability:
ActionScript 1.0; Flash Player 3
Parameters
command
:String
- A string passed to the host application for any use, or a command passed
to Flash Player.
parameters
:String
- A string passed to the host application for any use, or a value passed to
Flash Player.
Example
In the following example,
fscommand()
sets Flash Player to scale the SWF file to the full
monitor screen size when the
fullscreen_btn
or
unfullscreen_btn
button is released:
this.fullscreen_btn.onRelease = function() {
fscommand("fullscreen", true);
};
this.unfullscreen_btn.onRelease = function() {
fscommand("fullscreen", false);
};
The following example applies
fscommand()
to a button in Flash for the purpose of opening
a JavaScript message box in an HTML page. The message itself is sent to JavaScript as the
fscommand
parameter.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...