3 Events and Event Handlers
Events
Programs are like recipes. They are essentially a list of instructions. ActionScript programs tell the Flash Player what to do and when to do it. In a recipe for scrambled eggs, there might be an instruction like:
When the eggs start to brown on the bottom, turn them over.
This instruction deals with a phase of the recipe that is guaranteed to happen. But unpredictable things can happen when making scrambled eggs. Recipes generally don't address them, but if they did the instructions might look like:
If the doorbell rings before the eggs are done, remove them from the burner while you see who it is.
The ringing doorbell is an unpredictable event, and the response is considered common sense. Computers, of course, ...
Get Understanding Macromedia Flash 8 ActionScript 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.