views:

807

answers:

4

How do you capture the mouse events, move and click over top of a Shockwave Director Object (not flash) in Firefox, via JavaScript. The code works in IE but not in FF.

The script works on the document body of both IE and Moz, but mouse events do not fire when mouse is over a shockwave director object embed.

Update:

  function displaycoordIE(){
     window.status=event.clientX+" : " + event.clientY;
  }      
  function displaycoordNS(e){
     window.status=e.clientX+" : " + e.clientY;
  }
  function displaycoordMoz(e)
  {
      window.alert(e.clientX+" : " + e.clientY);
  }

  document.onmousemove = displaycoordIE;
  document.onmousemove = displaycoordNS;
  document.onclick = displaycoordMoz;
A: 

What code are you using, I don't see any?

Jason Bunting
A: 

Just a side note, I have also tried using an addEventListener to "mousemove".

Tanerax
+1  A: 

Just an idea.

Try overlaying the shockwave object with a div with opacity 0, then you can capture events on the div itself.

ken
+1  A: 

You could also catch the mouse event within Director (That never fails) and then call your JS functions from there, using gotoNetPage "javascript:function('" & argument & "')"

ej:

on mouseDown me
   gotoNetPage "javascript:function('" & argument & "')"
end

The mouse move detection is a little bit trickier, as there is no such an event in lingo, but you can use:

property pMouseLock

on beginsprite
   pMouseLock = _mouse.mouseLock
end
on exitFrame 
   if _mouse.mouseLock <> pMouseLock then
      gotoNetPage "javascript:function('" & argument & "')"
      pMouseLock = _mouse.mouseLock
   end if
end

regards

luna1999