Hi,

i am new member to this forum. i am trying to solve this problem from past 2 days.but i can't able to acheive it.

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

var picObj = document.createElement('EMBED'); [inlinecode] // --Create dynamically object tag [/inlinecode]

picObj.setAttribute('id','aShow'); // Give id to it

picObj.setAttribute('TYPE' , 'application/x-shockwave-flash');

picObj.style.width = 100%; // width

picObj.style.height = 100%; // height

picObj.src = "01.swf"; //--This is the Filename of the Flash ad.

// to capture onclick event for IE

//kiosk is the javascript function i am calling when an event accours

aShow.attachEvent("onactivate",kiosk); // it is working fine 

// For Firefox,i tried onfocus,onclick,onmousedown,not working

document.getElementById('aShow').addEventListener("focus",kiosk,true); // not working

document.getElementById('aShow').addEventListener("click",kiosk,true); // not working

document.getElementById('aShow').addEventListener("mousedown",kiosk,true); // not working

can any one help me to solve my problem

A.suresh

AFAIK, Firefox always had problems with supporting the 'attachEvent' function which works properly in IE and Opera.

Try something like: aShow.onactivate = kiosk; This code would work in all browsers. And I am pretty sure that only IE supports something like 'onactivate' since it doesn't seem to be a standard event. Maybe 'onfocus' would be more like it but them again I haven't really tried it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.