HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... Flash swf cannot call javascript function in build
Flash swf cannot call javascript function in build
  View type:
I have a flash module that I added to a slide. The flash module has a button that calls the javascript function next();

I created the next() function inside the file start.html so it will be included on all the pages.

This function looks like this:
fuction next(){
var oArgs = new Object;
oArgs.pid ='OBJ_5';
CallMethod('nav_008_next', 'JumpNext', oArgs);
//return false;
}

I created this function by looking at how the default project's navigation works in the file runtime.xml. Both my function and the onclick event are identical minus the commented out return.

However it appears that Courselab's builds block the flash from successfully calling the function.

Any help provided would be greatly appreciated.

Thanks,
Kevin
 
It functions without problems but you must open the start.html from a webserver (f.i. Abyss) or else the flash player will block communication. [:cool:]

Just for a small test:
Make a fla (as2) with in frame 1 two movieclips btn1 and btn2 and a textfield t.
In another layer in frame 1 write some actionscript:
import flash.external.ExternalInterface;
btn1.onPress = function()
{
_root.t.text = "1";
ExternalInterface.call("testJs");
}
btn2.onPress = function()
{
_root.t.text = "2";
ExternalInterface.call("testJs");
}

Put the swf in a small CL project; no extra parameters.

In start.html add this javascript function:
function testJs()
{
alert("testJs");
}

Publish to CD and put the whole map on a webserver. Open start.html and voila.
[:D]
Subject:
Message options
No additional options