Help - getURL, FSCommand, javascript (not about pop-up windows)

There seems to be like 8000 threads on how to make pop-up windows. This isn’t one of them. :wink:

I’m working on an eLearning program that uses SCORM. All of the stuff out there makes use of FSCommands to communicate with the Learning Management System, which is worthless on the Mac. I know you can use getURL to access javascript functions. I’ve already tested that, and simple things work fine (like popping up an alert).

I need help with implementing the specific stuff here. It’s more complicated than a simple alert or pop-up, and I’m getting nowhere. Any hints would be appreciated.

Setup:

Javascript fragment: (the function name and “LMSSetValue” are the important things.) This is straight from the macromedia template you get when you publish a flash file with the SCORM tracking html.

function Loader_DoFSCommand(command, args){
	var LoaderObj = g_bIsInternetExplorer ? Loader : document.Loader;
	// no-op if no SCORM API is available
	var myArgs = new String(args);
	var cmd = new String(command);
	var v = "";
	var err = "true";
	var arg1, arg2, n, s, i;
	var sep = myArgs.indexOf(",");
	if (sep > -1){
		arg1 = myArgs.substr(0, sep); // Name of data element to get from API
		arg2 = myArgs.substr(sep+1) 	// Name of Flash movie variable to set
	} else {
		arg1 = myArgs
	}
	if (!APIOK()) return;
	if (cmd.substring(0,3) == "LMS"){
		// Handle "LMSxxx" FScommands (compatible with fsSCORM html template)
		if ( cmd == "LMSInitialize" ){
			err = (APIOK() + "")
			// The actual LMSInitialize is called automatically by the template
		}	else if ( cmd == "LMSSetValue" ){
			err = SCOSetValue(arg1,arg2)

The normal FSCommand actionscript function:

function apiSetScore(nMin,nMax,nRaw) {

	fscommand("LMSSetValue", "cmi.core.score.min," + nMin);
	fscommand("LMSSetValue", "cmi.core.score.max," + nMax);
	fscommand("LMSSetValue", "cmi.core.score.raw," + nRaw);

}

The getURL I’m trying to replace the FSCommands with:

getURL("javascript:Loader_DoFSCommand('LMSSetValue', 'cmi.core.score.raw,' + nRaw)");

I’m definitely hitting my apiSetScore function fine. I put an alert javascript in there and that works. But the DoFSCommand is not doing anything. I really need some help guys!