[tough] Any way to declare a custom event?

Hi,

This might be extremely hard to do or not even possible (as far as I know), but I was wondering if anybody had any code that allowed users to define they own “event” and add a listener for it.

For example (in pseudo code):

event footToGround 
   code here that detects if players foot mc has tounged the ground mc
}
function fTG {
   trace("foot has touched ground");
}
stage.addEventListener(footToGround, fTG);

This would eliminate the need for onEnterFrame for constant detection and enhance the performance of a game or website with the less and less onEnterFrames, timers or setIntervals that are used on a Flash application.