Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch click on flash player?

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.

like image 491
user52005 Avatar asked Jan 24 '23 22:01

user52005


1 Answers

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.

like image 65
Yuval Adam Avatar answered Feb 01 '23 09:02

Yuval Adam