Hello,
I am having a problem with an externalInterface call from a SWF to a javascript function. i am on a new Moodle 2.0 LMS which I am not too familiar with yet.
Any help would be greatly appreciated.
function reenableMainConsole():void
{
txtErrors.text = "In reenableMainConsole function.
";
if (ExternalInterface.available)
{
txtErrors.text += "In extInterface.
";
try
{
ExternalInterface.addCallback("sidetrackStop", receivedFromJavaScript);
if (checkJavaScriptReady())
{
txtErrors.text += "JavaScript is ready.
";
}
else
{
txtErrors.text += "JavaScript is not ready.
";
}
}
catch (error:SecurityError)
{
txtErrors.text += "A SecurityError occurred: " + error.message + "
";
}
catch (error:Error)
{
txtErrors.text += "An Error occurred: " + error.message + "
";
}
function receivedFromJavaScript(value:String):void
{
txtErrors.text += "JavaScript says: " + value + "
";
}
function checkJavaScriptReady():Boolean
{
var isReady:Boolean=ExternalInterface.call("isReady");
txtErrors.text += "isReady: " + isReady;
return isReady;
}
}
else
{
txtErrors.text += "Not in extInterface.";
}
}