Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: JavaScript and Opus Flex
PostPosted: July 24th, 2007, 5:55 pm 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
I’m building a website with Opus Flex, which incorporates an external flash file. This works very well, apart from the fact that Internet Explorer requires of the viewer that they should “Press SPACEBAR or ENTER to activate and use this control”. This is obviously very annoying, and I believe there is a JavaScript workaround that avoids this.

If anyone can let me know the relevant Javascript, and where to place it in the html, I'd very much appreciate it.


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 24th, 2007, 6:20 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
http://www.adobe.com/devnet/activecontent/articles/devletter.html

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 24th, 2007, 6:34 pm 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
Thanks a lot. I might have known that Adobe would have a solution, and I appreciate your pointing me in their direction.

Regards


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 25th, 2007, 6:16 pm 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
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 :oops: , 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="">&nbsp;</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>


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 25th, 2007, 8:09 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
Try this one:
http://www.ediy.co.nz/internet-explorer-flash-applet-activation-fix-xidc19237.html

You can try Fix Option 1 or Fix Option 2, whichever one works the best for you. Personally, I would opt for Option 2, but that's just me. It looks like you just add a <SCRIPT> line to the bottom of your document and then make sure the supplied .js file is where you specify in the SCRIPT line and you're good to go.

Hope this is easier and works for you.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: July 26th, 2007, 8:07 am 
Offline

Joined: November 3rd, 2004, 4:12 pm
Posts: 173
Location: UK
It works! I really am very grateful.

Thanks once again.


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group