What is the difference between the event handling paradigms between Flash Builder 4 and Flash CS5 ? Flash is timeline based while Flex allows it to be in a XML file. This page explains how to dispatch an event from the timeline, but in Flash Builder 4 there is no concept of timeline, hence what i开发者_StackOverflow中文版s the event model?
The event model for both is the same, events are fired and consumed. It's based on the DOM event model outlined by W3C, and essentially, an implementation of the Observer Pattern (GOF)
The timeline model is entirely separate, however, the Flash engine does fire EnterFrame events as the timeline/playhead advances. The EnterFrame event has been used from the early days of Flash to create dynamic (code based) animations.
Further Reading:
- Understanding AS3 Event Flow
- Flex event listeners
- Flex event dispatchers
精彩评论