2. calling ffish scripts from within as3 synchorously
i) you can call it directly by using the ExternalInterface object
Code:
ExternalInterface.call("ffish_run", "myscript");
ii) first define a function, then call the function
Code:
function callFS(name)
{
ExternalInterface.call("ffish_run", name);
}
callFS("myscript");
3. calling ffish script functions from within as3 synchorously
i) first define the function in ffish script ("initialize" script)
Code:
function fsMethod(x, y)
{
***return x + y;
}
ii) calling the ffish script function in as3 by using the ExternalInterface
Code:
ExternalInterface.call("fsMethod", 123, 56.0);
or first define the function in as3:
Code:
function _fsMethod(x, y)
{
return ExternalInterface.call("fsMethod", x, y);
}
ret = _fsMethod("hello ", "world");
or use the "ffish_eval" command
Code:
ExternalInterface.call("ffish_eval", "fsMethod(123, 56.1);");