The
command can contain only the characters A–Z, a–z, 0–9, period (.), and underscore
exec
(_). The
command runs in the subdirectory fscommand only. In other words, if you use the
exec
fscommand exec
named fscommand.
Usage 2: To use the
JavaScript in a web browser, you can pass any two parameters in the
parameters. These parameters can be strings or expressions and are used in a JavaScript function
that handles, or catches, the
In a web browser, the
moviename_DoFScommand
name of the Flash Player as assigned by the
the
tag. If you assign the Flash Player the name
OBJECT
called is
myDocument_DoFScommand
Usage 3: The
fscommand()
interpreted by Lingo (Director's scripting language) as strings, events, or executable Lingo code. If
the message is a string or an event, you must write the Lingo code to receive the message from the
function and carry out an action in Director. For more information, see the
fscommand()
Director Support Center at www.macromedia.com/support/director.
Usage 4: In Visual Basic, Visual C++, and other programs that can host ActiveX controls, the
function sends a VB event with two strings that can be handled in
fscommand()
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.
Example
In the following example, the
full monitor screen size when the
this.fullscreen_btn.onRelease = function() {
fscommand("fullscreen", true);
};
this.unfullscreen_btn.onRelease = function() {
fscommand("fullscreen", false);
};
The following example uses the
JavaScript message box in an HTML page. The message itself is sent to JavaScript as the
parameter.
fscommand
You must add a function to the HTML page that contains the SWF file. This function,
myDocument_DoFSCommand
Flash. When an
and
command
parameter
use the passed strings in your JavaScript or VBScript code in any way you like. In this example,
the function contains a conditional
. If it is, a JavaScript alert box (or "message box") opens and displays the contents
"messagebox"
of the
parameters
306
Chapter 2: ActionScript Language Reference
command to call an application, the application must reside in a subdirectory
function to send a message to a scripting language such as
fscommand()
fscommand()
function calls the JavaScript function
fscommand()
in the HTML page containing the SWF file. The
.
function can send messages to Macromedia Director that are
fscommand()
fullscreen_btn
fscommand()
, sits in the HTML page and waits for an
is triggered in Flash (for example, when a user presses the button), the
fscommand
strings are passed to the
if
string.
function.
attribute of the
NAME
myDocument
function sets Flash Player to scale the SWF file to the
button or
function applied to a button in Flash to open a
myDocument_DoFSCommand
statement that checks to see if the command string is
and
command
parameters
moviename
tag or the ID property of
EMBED
, the JavaScript function
is released:
unfullscreen_btn
function in
fscommand()
function. You can
is the
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?