function myFunc(x, y)
{
return x + y;
}
function myMethod(x, y)
{
return x + y + y;
}
ExternalInterface.addCallback("myFunc", null, myFunc);
ExternalInterface.addCallback("myFunc2", null, myMethod);
in actionscript 3 (Flash cs3 or Flex 2)
function myFunc(x, y) {
return x + y;
}
function myMethod(x, y) {
return x + y + y;
}
ExternalInterface.addCallback("myFunc", myFunc);
ExternalInterface.addCallback("myFunc2", myMethod);
And then you can register the methods in ffish script and call them
// The "registerASMethods" method turns any as2 or as3
// callback functions into ffish script global functions. That is to say,
// you can call the action script functions directly in ffish script
// after calling this method
Application.registerASMethods("myFunc", "myFunc2");
trace(myFunc("hello ", "world"));
trace(myFunc2("hello ", "world"));