Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I call flash cs6 from javascript

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?

like image 841
Ilya Gazman Avatar asked Jun 07 '26 04:06

Ilya Gazman


1 Answers

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
}
like image 69
kenecaswell Avatar answered Jun 10 '26 16:06

kenecaswell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!