FutureSplash Player 1.1 adds support for Netscape's LiveConnect and enhances the scripting support for ActiveX. The ability to control the FutureSplash Player from JavaScript and the ability to activate JavaScript from your .spl files opens up many new possibilities in creating highly interactive web pages. Before trying these things, it is important to realize that JavaScript is a new and immature technology and things may not go a smoothly as they should. Also, FutureSplash scripting requires Netscape Navigator 3.0 (Windows 95/NT or Mac PowerPC only) or Internet Explorer 3.0 with ActiveX support. As a first step, be sure and try the FutureSplash scripting demo.
There are lots of good JavaScript references on the Internet. Including:
There are two basic actions that can be performed with FutureSplash scripting. The first type of action is to control FutureSplash Player using a method such as Play(), GotoFrame(), or CurrentFrame(). The second type of action is to send a message from a FutureSplash button or frame action to JavaScript code in your web page with FSCommand. More details are provided below. Be sure to download the files in the scripting demo (.zip format, or .sit format) and examine it as an example.
These are the methods of the FutureSplash Player that can be called.
To call methods in a FutureSplash Player movie, your EMBED and OBJECT tags must have a name/id as shown in red below. Also note the "#ver=1,1,0,0" ensures that the proper version of the ActiveX control is installed.
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="mapcontrols" WIDTH=100 HEIGHT=100 CODEBASE="http://www.futurewave.com/fsplash.cab#ver=1,1,0,0"> <PARAM NAME="Movie" VALUE="controls.spl">
<EMBED NAME="mapcontrols" MAYSCRIPT SRC="controls.spl" WIDTH=100 HEIGHT=100 PLUGINSPAGE="http://www.futurewave.com/downloadfs.htm">
</OBJECT>
Here is an example of calling methods from JavaScript:
<SCRIPT LANGUAGE="JavaScript">
<!--
// Handle special cases where we need different code for Internet Explorer vs. Netscape navigator
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// IE and Navgiator have slightly different document object models
// IE treats objects as members of "window" while in Navigator,
// embeded objects are members of "window.document"
var mc = InternetExplorer ? window.mapcontrols : window.document.mapcontrols;
mc.Rewind();
mc.Zoom(0);
//-->
</SCRIPT>
To send messages when a FutureSplash button is clicked or when a certain frame in a movie is reached, use a psuedo-URL with the prefix "FSCommand:" in the GetURL button or frame action in FutureSplash Animator. The text following the FSCommand: in the URL box is called the command string and the text in the target box is called the args string. These strings are passed to your JavaScript code and can be used for any purpose you need. To respond to FSCommand messages in JavaScript, you should include the code as shown below. Note the red "mapcontrols" name. This portion of the function names must match the name/id set in the OBJECT and EMBED tags of the FutureSplash movie that is sending the FSCommand messages.
<SCRIPT LANGUAGE="JavaScript">
<!--
// Handle special cases where we need different code
// for Internet Explorer vs. Netscape navigator
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a FutureSplash movie function
mapcontrols_DoFSCommand(command, args) {
// IE and Navgiator have slightly different document object models
// IE treats objects as members of "window" while in Navigator,
// embeded objects are members of "window.document"
var map = InternetExplorer ? parent.fw_map.map : parent.fw_map.document.map;
if ( command=="home" ) {
map.Rewind();
map.Zoom(0);
} else if ( command=="zoom" ) {
// Zoom in or out by a percentage specified in args
map.Zoom(parseInt(args)); }
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
// Map VB script events to the JavaScript method - Netscape will ignore this...
// Since FSCommand fires a VB event under ActiveX, we respond here
Sub mapcontrols_FSCommand(ByVal command, ByVal args)
call mapcontrols_DoFSCommand(command, args)
end sub
-->
</SCRIPT>
The ActiveX version of FutureSplash contains additional Visual Basic style properties that are described in the Sample HTML document that is included with the complete version of FutureSplash Animator.
Netscape plug-ins support using URLs of the form "javascript:" in the GetURL action in your .spl this can be used instead of FSCommand if you only want to work with Netscape Navigator.
Copyright ©1996
FutureWave Software, Inc.
Comments and questions: webmaster@futurewave.com