flash - Call an javascript function and pass in callback function -


i want call javascript function in action script, this:

externalinterface.call('a_js_function', param1, another_js_function); 

i want javascript function a_js_function takes in 2 params, 1 string, 1 callback function. can call js function this:

function a_js_function(teststr, callback) {     console.log(teststr);     callback(teststr); }  function another_js_function(str) {     console.log(str); } 

what correct way this?

problem solved, turns out second passed in string, in javascript have turn string function in order call it.

call

try {        externalinterface.call('a_js_function', param1, another_js_function);         } catch(e:error) {         trace(e)         } 

and more information see this


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -