FS Command

Use this Action to send commands to the browser or player.

panels-action-fscommand.png  

Command
You can specify the command to enter.
 
Argument
This provides extra information to the script for the given command.

Note: When playing within SWiSH, FS Command Actions are not performed

Using FSCommand with the stand-alone Flash Player or Projector
If the .swf Movie is playing within a stand-alone Flash Player or a projector, then you can only use one of the predefined FS commands. Those predefined FS commands appear in the drop-down list on the FS Command action page:

AllowScale
True: displays the SWF scaled (not always 100%)
False: SWF is always 100%.
 
ShowMenu
True: displays the full Flash Menu on right-click (Windows). Displays the full Flash Menu on control click (Mac)
False: displays "About Shockwave Flash" only (Windows). Greys out the Menu (Macintosh).
 
FullScreen
True: SWF is displayed full screen
False: SWF is displayed at original size.
 
Exec
Program Name: executes the specified program. This command is valid for stand-alone projectors only.
 
Quit   
Quits the SWF.


Using FS Command within an HTML document in a browser
If the Movie is playing within an HTML document in a browser, then there are no predefined commands. Instead, the FS Command Action triggers some JavaScript/VBScript within the HTML page. This script has to test for the command name, and should then run appropriate script commands. The argument value is also available to the script to use as it is required.

When you use the 'Export HTML' command, SWiSH will add the necessary basic script to the HTML document when you export the movie. All you have to do is to implement the function at the place marked as "// ADD YOUR CODE HERE" in the exported HTML document.

In the example below, the Movie will call the embedded script function TestFunction in the HTML document when the mouse button is pressed inside the current object.

panels-action-fscommand-example.png  

SWiSH will add the following script to the beginning of the HTML document when you export the movie. Then you can replace "// ADD YOUR CODE HERE" with your own code.

<SCRIPT LANGUAGE="JavaScript">  
<!--  
// Detect Browser  
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;  
// FSCommand handler for Netscape  
function Movie1_DoFSCommand(command, args) {  
var Movie1Obj = InternetExplorer ? Movie1 : document.Movie1;  
if (command=="TestFunction") {  
// ADD YOUR CODE HERE  
}  
}  
//-->  
</SCRIPT>  
<SCRIPT LANGUAGE="VBScript">  
<!--  
// FSCommand handler for VBScript and ActiveX  
Sub Movie1_FSCommand(ByVal command, ByVal args)  
call Movie1_DoFSCommand(command, args)  
end sub  
//-->  
</SCRIPT>  


[Previous] [Main] [Next]