How to write an eventdispatcher

How to write as2.0 using class to respond a simple event handler for several mc’s ?

Just as simple as :

button1.onPress = function() {
trace(“hello!”);
}

button1.onRollOver = function() {
this.gotoAndStop(1);
}

does anyone have some good examples of using eventDispatcher method in a class?