The code below shows how to pass a callback function in Flex.
I need to pass a javascript callback function named ‘jsf’ to f1.
How would I create a reference to the callback function ‘jsf’ which is in a .js file?
ie. f1(jsf);
function f():void { trace("I am callback"); }
var v:Vector.<Function> = new <Function>[];
function f1(callBack:Function):void
{
trace("I register callBack");
v.push(callBack);
}
function f2():void
{
trace("I call the callBack");
v[0]();
}
f1(f);
f2();
Thanks
I think you’re looking for this:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html
and the call method, more on it here:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf626ae-7fe8.html#WS2db454920e96a9e51e63e3d11c0bf69084-7f31