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
Hi,

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:

[HTML]<script>

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');
picObj1.setAttribute('play','true');
picObj1.setAttribute('wmode','opaque');
picObj1.setAttribute('width','100%');
picObj1.setAttribute('height','100%');
picObj1.setAttribute('src','02.swf');

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

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

</script>

<body>

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

</body>[/HTML]
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

A.suresh
Jul 13 '07 #2

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

gits
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
Hi,

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
  2.  
  3. picObj.setAttribute('id','aShow'); // Give id to it
  4.  
  5. picObj.setAttribute('TYPE' , 'application/x-shockwave-flash');
  6.  
  7.  picObj.style.width = 100%;   // width
  8.  
  9. picObj.style.height = 100%;   // height
  10.  
  11. picObj.src = 01.swf; //--This is the Filename of the Flash ad.
  12.  
  13. // to capture onclick event for IE
  14.  
  15. //kiosk is the javascript function i am calling when an event accours
  16.  
  17. aShow.attachEvent("onactivate",kiosk);   // it is working fine 
  18.  
  19. // For Firefox,i tried 'onfocus' also
  20.  
  21. document.getElementById('aShow').addEventListener("focus",kiosk,true);  // not working

can any one help me to solve my problem



A.suresh
Aug 4 '07 #5

pbmods
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.