How can I return a value from AS3 to javascript. I am calling a AS3 method from JS and want that AS3 method to return back a string:
//javascript
var string = swfObject["abcmethod"](arg1);
The only way I know of is to add a callback method which is called from flash back in JS. Is there a better way?
The communication pipe between AS3 and Javascript does support passing a value back to the Javascript function called. It’s in the docs:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html
If the code you have isn’t working, try using a different syntax. The following is what I usually use:
Your code in actionscript should be something like: