I can't figure out how to do it. It would seem to be something like this:
function MyObject() {
this.fireEvent("myEvent");
}
And then in a separate JavaScript file:
var obj = new MyObject();
obj.addEventListener("myEvent", function() {
alert("Event Fired");
});
But of course it doesn't work. My question is, how would I go about doing something like that?