fscommand()
Top  Previous  Next


SWiSH Player Support
SWF4 or later - Supported Internally

Syntax
fscommand("command", "Arguments")

Arguments
command: A string passed to the host application for any use or a command passed to the stand-alone Flash Player.
Arguments: A string passed to the host application for any use or a value passed to the Flash Player.

Returns
Nothing.

Description
Action: Allows the Flash Movie to communicate with:
·The .exe Flash Player.  
·The program hosting the Flash Player, such as a Web browser.  
·Other programs that can host ActiveX controls such as Visual Basic or Visual C++.  

Usage 1: To send a message to the Flash Player, you must use predefined commands and Arguments. The following table shows the values you can specify for the command and Arguments of the fscommand Action to control a Movie playing in the stand-alone Flash Player (including projectors):

Command   Arguments   Purpose   
quitNone   Closes the projector     
fullscreentrue or false   Specifying true sets the Flash Player to full-screen mode. Specifying false returns the player to normal Menu view     
allowscaletrue or false   Specifying false sets the player so that the Movie is always drawn at its original size and never scaled. Specifying true forces the Movie to scale to 100% of the player     
showmenutrue or false   Specifying true enables the full set of context Menu items. Specifying false dims all the context Menu items except About Flash Player     
execPath to app.   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 the Flash Player  
 
Usage 2: To use the fscommand Action to send a message to a scripting language such as JavaScript in a Web browser, you can pass any two Arguments in the command and Arguments. These Arguments can be strings or expressions and are used in a JavaScript function that 'catches', or handles, the fscommand Action.

In a Web browser, the fscommand Action calls the JavaScript function moviename_DoFScommand in the HTML page containing the Flash Movie. The moviename is the name of the Flash Player as assigned by the NAME attribute of the EMBED tag or the ID property of the OBJECT tag. If you assign the Flash Player the name myMovie, the JavaScript function called is myMovie_DoFScommand.

Usage 3: In Visual Basic, 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.

Samples
In the following example, the fscommand Action sets the Flash Player to scale the Movie to the full monitor screen size when the button is released.

on(release){
    fscommand("fullscreen", true);
}