I`m using SWFObject for flash player on my webpage. Player as usual has buttons like Play, Stop, Pause etc. I need to catch moment, when my user click on any button and i need to execute some JS-function in this time. Sorry for my english and thanks a lot in advance. P.S. I dont have sources of my swf file.
AFAIK, this is done via the getURL()
function. You need to define the following in the action script of the flash file:
this.onClick = function(){
getURL("javascript:yourFunctionName();");
};
This means you can't just take any flash file and make it call JS functions, it must be defined within the flash file itself.
If I am wrong, I'd love to hear how this can be done more generically without editing the flash itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With