Hi, I have a WMP player object and I'm trying to add an event listener to intercept ScriptCommands that are sent to the player. Instead of being attached to the WMP object, my callback is being called right away, and then the ScriptCommands aren't being intercepted.
function init() {
var WMPlayer = document.getElementById("WMPlayer");
WMPlayer.addEventListener("ScriptCommand", MyScriptCommand(), false);
alert('init');
}
function MyScriptCommand() {
alert('script');
}
When I run this, I get the script alert before the init alert.... Does anyone know why this might be happening?