I have a calc function in java script that takes three integer parameters, following is the AS3 code
import flash.external.ExternalInterface;
var para:Array = new Array();
send_btn.addEventListener(MouseEvent.CLICK, clickListener);
function clickListener(eventObj:Object ):void {
para.push(mean.text);
para.push(std.text);
para.push(points.text);
trace("click > " + para);
ExternalInterface.call("calc",para );
}
is this the right way of doing it and how do i get back 3 arguments back from the javascript and display them in flash?
In addition, you need to register your AS function so that it's available to the container:
Then, from your container (JS), you call the AS function and pass whatever parameters you want to it.
Lastly, in AS3, you write the function that will be executed when the container "calls back":