Reputation: 32271
So how does JavaScript works in the new Flash Pro CS6?
To call JavaScript you are using the new interface:
/* js
alert("Hello from JavaScript");
*/
But how do you call to flash from JavaScript?
Upvotes: 3
Views: 424
Reputation: 7598
Check out this quick tutorial, it worked for me: http://circlecube.com/2010/12/actionscript-as3-javascript-call-flash-to-and-from-javascript/
That tutorial is fairly old (before CS6), so it explains how to call js from flash and vice versa. The essential part that you want is this actionScript:
ExternalInterface.addCallback("name_of_js_function", name_of_as3_function);
function name_of_as3_function():void {
// I was called from javascript
}
Upvotes: 1