AsBroadcaster to self vs. simply calling the function

Hello good people!

I’m writing a class that needs some hooks in it for events. So you can create an instance and then add functionality to it by adding a method like this:

bunny = new Bunny()
bunny.onHop = function(){
this.turnGreen()
}

Then in the Bunny class every time it hops I would provide a hook for the event.

Well my initial approach was to initiate AsBroadcaster and have the event ‘onHop’ broadcasted every time the bunny hopped. That works fine but I realized that in this situation there didn’t seem to be any difference between these two:

private function seeCarrot(){
this.broadcastMessage(‘onHop’)
hop()
}

and:

private function seeCarrot(){
this.onHop()
hop()
}

The thing is I don’t really like the idea of calling functions that don’t exist in the class and are optional for the user of the class. But it is surely a lot less code to just call the function and if it is defined by the user great, if not it just goes into the ether or whatever happens to function calls to undefined functions in Flash…

So I was wondering if anyone had any input. Is there anything technically wrong with calling undefined functions in flash? I personally feel that broadcasting the message to ‘this’ makes more sense somehow because the method may or may not be defined and really this is the kind of thing broadcasters are made for I think. But there doesn’t seem to be any difference in Flash when I just throw the function call out there and let it be picked up if there is anything to catch it.