FS Command
Top  Previous  Next


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

Panels-Action-FSCommand  

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

Note: When playing within SWiSHmax, 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, 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 file scaled (not always 100%)
False: .swf file is always 100%
 
ShowMenu
True: displays the full Flash Menu on right mouse click (Windows). Displays the full Flash Menu on control + mouse click (Mac)
False: displays "About Shockwave Flash" only (Windows). Greys out the Menu (Mac).
 
FullScreen
True: .swf file is displayed full-screen size
False: .swf file 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 file.


Using FS Command within an HTML document in a browser
If the Movie is playing within an .htm document in a browser, 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, SWiSHmax will add the necessary basic script to the .htm document when you export the Movie. All you have to do is to implement the function at the place marked "// ADD YOUR CODE HERE" in the exported .htm document.

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

Panels-Action-FSCommand-Example  

SWiSHmax will add the following script to the beginning of the .htm 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>