I've been grappling with Actionscript (Flash) intregration recently, largely for synchronising the dynamic elements here. In AS2, here's how it's done.
To call a function
Actionscript code
import flash.external.ExternalInterface;
ExternalInterface.addCallback( "methodName", this, method );
function method() {
trace("called from javascript");
}
Javascript code
function callAS() {
swf.methodName();
}
To push a variable
Javascript code
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
