2k views
Call a function in your Flash movie from Javascript
First, you need to define a callback in your Flash movie. To do it, use the addCallback function of the ExternalInterface class:
ActionScript 3
- // ...
- // ...
- {
- // ...
- }
After that, it is very easy to call your method using javascript:
Javascript
- document.getElementById("flashMovie").flashMethod(12345, "12345");
IMPORTANT WARNING: The code above would work in an ideal world. Unfortunately, the different browsers treat flash embeds in different ways and you need to use some hacks to make it work in all of them. Read this great article and follow its instructions: REFERENCING FLASH MOVIE USING JAVASCRIPT
Submitted by miguelSantirso over 2 years ago — last modified less than a minute ago