There are number of examples on the web. Last time I had to do this was back in the fscommand days. Some of the the key things I need to remember the next time I deal with JS<->AS communication are
When Flash is calling out to the external JavaScript, the ActionScript code must have:
ExternalInterface.call(”{externalJavaScriptMethodName}”, {parameters});
When calling from JavaScript into the internal Flash client, the Flash client must expose methods using:
ExternalInterface.addCallback(”{jsMethodName”, asFuncObjReference);
and the JavaScript code must properly reference the movie
function thisMovie(movieName) {
if (navigator.appName.indexOf(”Microsoft”) != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function playClip(url)
{
alert(url);
thisMovie(”${application}”).playClip(url);
}
Recent Comments