I've tried to modify the code in line with the Adobe update article, but I'm afraid my efforts haven't achieved very much. I hope you won't mind my asking this
, but I'd be grateful if you'd let me know how to amend the following script.
Thanks in advance.
<html>
<head>
<title>How it works</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="opus,multimedia authoring,multimedia development,development tools,development software,training software,education software,creative multimedia,interactive multimedia authoring tool,drag and drop multimedia,online training,business presentation">
<meta name="description" content="Created with Opus - a range of multimedia authoring tools and rich media presentation software for business and education by Digital Workshop">
</head>
<body bgcolor="#000080" onLoad="FocusFlashMovie();">
<div style="visibility: hidden position:absolute; width:0px; height0px">
<layer>
<A HREF="http://www.digitalworkshop.com" ALT="Digital Workshop" TITLE=""> </a>
</layer>
</div>
<center>
<OBJECT ID="How_it_works" CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="800" HEIGHT="600"
CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0">
<PARAM NAME="movie" VALUE="How it works.swf">
<PARAM NAME="menu" VALUE="false">
<PARAM NAME="quality" VALUE="high">
<EMBED NAME="How_it_works" SRC="How it works.swf" WIDTH="800" HEIGHT="600"
MENU="false" SWLIVECONNECT="true" QUALITY="high"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</center>
</body>
<script language=JavaScript>
<!--
//=============================================================================
// Main - The script can be customised by inserting code after DetectBrowser().
DetectBrowser(); // Calls DetectBrowser functo find out the client's browser type
//=============================================================================
// SCORM Functions
var LMSAPI = getAPI();
How_it_works.SetVariable("JSREADY", "true");
function JSFunction(jsf)
{
// This shouldn't be be necessary, but web page changes otherwise...
eval(jsf);
How_it_works.SetVariable("JSREADY", "true");
}
function ILMGetValue(name, retvar)
{
var value = LMSAPI.LMSGetValue(name);
How_it_works.SetVariable(retvar, value);
How_it_works.SetVariable("JSREADY", "true");
}
function ILMSetValue(name, value)
{
LMSAPI.LMSSetValue(name, value);
How_it_works.SetVariable("JSREADY", "true");
}
function ILMGetLastError(retvar)
{
var error = LMSAPI.LMSGetLastError();
How_it_works.SetVariable(retvar, error);
How_it_works.SetVariable("JSREADY", "true");
}
//=============================================================================
// Web Browser Detection Function
// Detects the client's browser type and sets the appropriate type
function DetectBrowser()
{
// Opus Flex supports three browser types.
// One of the following variables will contain TRUE if the
// detected browser type is Internet Explorer, Netscape 4, or Netscape 6.
IE = false; // Internet Explorer
NS4 = false; // Netscape 4 or below
NS6 = false; // Netscape 6 or above
UNKNOWN = false; // Unrecognised browser type
// Detect the client's browser type and set the appropriate variable.
if (document.all) {
IE = true; // Set the browser type to Internet Explorer
} else if (document.layers) {
NS4 = true; // Set the browser type to Netscape 4
} else if (document.getElementById) {
NS6 = true; // Set the browser type to Netscape 6
} else {
UNKNOWN = true; // Set the browser type to unknown type
}
// Platform type used for ActiveX events.
// Contains TRUE if the client is running any 32 bit Windows operating system.
WIN = false; // Windows operating system
// Detect the client's platform type.
if (navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
WIN = true;
}
}
//=============================================================================
// Focus Flash Movie
// Sets focus to the flash movie object.
function FocusFlashMovie()
{
if (IE) {
window.How_it_works.focus();
} else if (NS4 || NS6) {
window.document.How_it_works.focus();
}
}
//=============================================================================
// FSCommand Handling Functions
// FSCommand allows the Flash movie to interact
// with its host environment (a web browser). Opus Flex requires these functions
// to complement Illuminatus's suite of functionality.
// Handle all the the FSCommand messages in a Flash movie. Called from the VBScript.
function How_it_works_DoFSCommand(command, args)
{
// IE and Navgiator have slightly different document object models
// IE treats objects as members of "window" while in Navigator,
// embedded objects are members of "window.document"
// The following _obj variable can be used to call Flash's internal methods.
var movie_obj = IE ? How_it_works : window.document.How_it_works;
if (command == "ExitPublication") {
window.close();
}
if (command == "LoadBookmarks") {
var dc = document.cookie;
var prefix = "my_bookmarks=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = dc.length;
}
var cookie_text = unescape(dc.substring(begin + prefix.length, end));
movie_obj.SetVariable("_DW_bookmarks_cookie", cookie_text);
}
if (command == "SaveBookmarks") {
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 30)); // Expires in 30 days
var expires = "; expires=" + expdate.toGMTString();
document.cookie="my_bookmarks="+args+expires;
}
}
// When the Flash plugin is used under IE and Win32, a VBEvent is fired.
// To trap the VBEvent, the following VBScript code is used. The VBScript then
// explicitly calls _DoFSCommand JavaScript function to handle FSCommand.
// Note: FSCommand is handled under Netscape's LiveConnect technology. Netscape 6
// does not implement LiveConnect, therefore does not support Flash's FSCommand.
if (IE && WIN) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub How_it_works_FSCommand(ByVal command, ByVal args)\n');
document.write(' call How_it_works_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
//====================================================================
// More SCORM Functions
function findAPI(win)
{
// Search the window hierarchy for an object named "API"
// Look in the current window (win) and recursively look in any child frames
if (win.API != null) {
return win.API;
}
if (win.length > 0) { // does the window have frames?
for (var i=0;i<win.length;i++) {
var theAPI = findAPI(win.frames[i]);
if (theAPI != null) { return theAPI; }
}
}
return null;
}
function getAPI()
{
// start at the topmost window - findAPI will recurse down through
// all of the child frames
var theAPI = findAPI(this.top);
if (theAPI == null) {
// the API wasn't found in the current window's hierarchy. If the
// current window has an opener (was launched by another window),
// check the opener's window hierarchy.
if (typeof(this.opener) != "undefined") {
if (this.opener != null) {
theAPI = findAPI(this.opener.top);
}
}
}
return theAPI;
}
//-->
</script>
</html>