471,881 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

Onactivate Event for Flash object is not working in Firefox


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', 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,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
5 4696
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
16,027 Expert Mod 8TB
I don't work with Flash, but does a simple onclick not work?
Jul 14 '07 #3
5,390 Expert Mod 4TB
... 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

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.  picObj.style.width = 100%;   // width
  9. picObj.style.height = 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
5,821 Expert 4TB
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.

Similar topics

3 posts views Thread by Philip | last post: by
18 posts views Thread by gconrads | last post: by
2 posts views Thread by avanhalen | last post: by
2 posts views Thread by cgdev1 | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.