By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Onactivate Event for Flash object is not working in Firefox

P: 32

I am facing one problem in embed flash object.i am displaying the flash (.swf file) using embed tag<embed> in IE.i want to display the alert box when user click the mouse over the flash .i am able to display the alert box only when user double click the flash .but i want alert box need to display when single mouse click over flash.

my code:


function kiosk(){ // fn will be called when user click mouse
alert(" i received the mouse click");

//-------------- creating the embed flash object
var picObj1 = document.createElement('EMBED');
picObj1.setAttribute('id',"aShow"); // Give id to it
picObj1.setAttribute('TYPE' , 'application/x-mplayer2');
picObj1.setAttribute('PLUGINSPAGE', ',4,7,1112');

aShow.attachEvent("onmousedown",kiosk); // i am attaching "onmousedown" event

document.getElementById('displayarea').appendChild (picObj1);



<div id="displayarea"></div>

Please post in code tags - moderator
Feb 19 '07 #1
Share this Question
Share on Google+
5 Replies

P: 32
Hi guys

I able to capture the mouse click in Flash object(.swf file) using 'onactivate' Event Handler.But it works fine in IE.But its not working in Firefox.I heard the 'onactivate event will support only IE.

Is there any mouse event to capture single mouse click in flash object for firefox
I am looking for some help from you guys

Jul 13 '07 #2

Expert Mod 15k+
P: 16,027
I don't work with Flash, but does a simple onclick not work?
Jul 14 '07 #3

Expert Mod 5K+
P: 5,390
... But its not working in Firefox.I heard the 'onactivate event will support only IE. ...
that's correct ... have a look at the following link:

mouse events

may be it is of some help to you ...

kind regards
Jul 14 '07 #4

P: 32

I able to capture single mouse click over flash(<Embed> object) using onactivate event handler.But it is supported by IE. i want some event in Firefox that will capture the mouse click over flash object.

i attached my code
Expand|Select|Wrap|Line Numbers
  1. var picObj = document.createElement('EMBED');  // --Create dynamically object tag
  3. picObj.setAttribute('id','aShow'); // Give id to it
  5. picObj.setAttribute('TYPE' , 'application/x-shockwave-flash');
  7. = 100%;   // width
  9. = 100%;   // height
  11. picObj.src = 01.swf; //--This is the Filename of the Flash ad.
  13. // to capture onclick event for IE
  15. //kiosk is the javascript function i am calling when an event accours
  17. aShow.attachEvent("onactivate",kiosk);   // it is working fine 
  19. // For Firefox,i tried 'onfocus' also
  21. document.getElementById('aShow').addEventListener("focus",kiosk,true);  // not working

can any one help me to solve my problem

Aug 4 '07 #5

Expert 5K+
P: 5,821
Suresh, please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

I will not ask you again.
Aug 4 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.