Events firing but no event data, how do I get it

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
SteveRicketts
Blank Cone
Blank Cone
Posts: 53
Joined: 29 May 2008 00:10

Events firing but no event data, how do I get it

Postby SteveRicketts » 20 Mar 2011 12:38

I copied the code out of http://wiki.videolan.org/Documentation:WebPlugin to register vlc events to help me figure out why vlc is not running in IE. Two events fire, but the event is null as is windows.event. How to I get the information on what event fired?

// event callback function for testing
function handleEvents(event)
{
if (!event) // <------------------------- event is null here
event = window.event; // IE <-------------- window.event also null
if (event.target) {
// Netscape based browser
targ = event.target;
} else if (event.srcElement) {
// ActiveX
targ = event.srcElement;
} else {
// No event object, just the value
alert("Event value" + event );
return;
}
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
alert("Event " + event.type + " has fired from " + targ );
}

jack.ting
Blank Cone
Blank Cone
Posts: 35
Joined: 19 Jan 2011 04:04

Re: Events firing but no event data, how do I get it

Postby jack.ting » 21 Mar 2011 07:48

Hi, SteveRicketts:

I've the same problem of identifing the event source, too.
And, it seems there's no related discussion of such topic. (I've posted one on the windows related board, but got no answer)

Since that I only want to catch/process one event (the 'MediaPlayerEndReached'),
so instead I check the input.state of all my VLC instances as a alternate solution.

I've download the source code, and trying to figure out why.
But due to the limitation of my programming knowledge of ActiveX, Mozilla plugin, and the spec. of javascript, currently I still found nothing at all.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 4 guests