Automatic event handling would immediately take us to the next stop on the list, probably the first stop in the list of stops. But we need greater control over the actual event. We want to ask if the bus is at the last stop on its route, and if it is, we need to stop it. This is advanced event handling.
This looks simple on the surface - but what if passengers get on at the last stop? And pay? What if people are still on the bus? Good programming would find answers to all of these problems.
Some problems do have solutions without advanced event handling, but if we are able to use advanced event handling, we will find that simple and practical solutions to these sort of problems are readily available.
Advanced Event Handling consists of three sections:
Cancelling Events
Event Bubbling
Mouse Capture
No comments:
Post a Comment