0

Is there any way for Flash's ActionScript3 to communicate with a JavaScript function defined inside an AMD module - ie. not directly exposed to the global scope?

gsklee
  • 4,774
  • 4
  • 39
  • 55

1 Answers1

0

Create a JS function on the global scope which in turn calls the function inside the AMD module.

-or-

write the global js function in the external interface call:

ExternalInterface.call( "function uniqueFunctionName(){ myModule.foo(); }" );
Creynders
  • 4,573
  • 20
  • 21
  • I'd like to avoid attaching anything to the global scope for security reasons (so the methods can't be invoked by typing `javascript:fn();` into the address bar of the browser). – gsklee Oct 04 '12 at 05:42
  • added another solution to my answer – Creynders Oct 04 '12 at 08:54