User Guide
fscommand() 161
fscommand()
Availability
Flash Player 3.
Usage
fscommand("command", "parameters")
Parameters
command
A string passed to the host application for any use, or a command passed to
Flash Player.
parameters A string passed to the host application for any use, or a value passed to
Flash Player.
Returns
Nothing.
Description
Function; lets the SWF file communicate with either Flash Player or the program hosting Flash
Player, such as a web browser. You can also use the
fscommand() function to pass messages to
Macromedia Director, or to Visual Basic, Visual C++, and other programs that can host
ActiveX controls.
Usage 1: To send a message to Flash Player, you must use predefined commands and parameters.
The following table shows the values you can specify for the
command and parameters
parameters of the
fscommand() function to control a SWF file playing in Flash Player,
including projectors. (A projector is a SWF file saved in a format that can run as a stand-alone
application—that is, without Flash Player.)
Command Parameters Purpose
quit None
Closes the projector.
fullscreen
true
or false Specifying true sets Flash Player to full-screen mode.
Specifying
false returns the player to normal menu view.
allowscale
true
or false Specifying false sets the player so that the SWF file is always
drawn at its original size and never scaled. Specifying
true
forces the SWF
file to scale to 100% of the player.
showmenu
true
or false Specifying true enables the full set of context menu items.
Specifying
false dims all the context menu items except About
Flash Player.
exec
Path to
application
Executes an application from within the projector.
trapallkeys
true
or false Specifying true sends all key events, including accelerator keys,
to the
onClipEvent(keyDown/keyUp) handler in Flash Player.
CHAPTER 5
ActionScript Core Language Elements