Help understanding Cairngorm Event in Flex
I was going through this article by David Tucker (http://www.davidtucker.net/2007/10/29/cairngorm-part-3/) in which 开发者_如何学JAVAhe talks about Cairngorm Events.
There are two things that I want to ask in this-
What is the significance of calling the constructor of the parent class with the event arg? super(LOGIN) in the example
Why do you need to overrride the clone method?
Understanding these things will give me a better insight into the way things are done with Cairngorm.
Thanks
Both questions are not specific to Cairngorm events. This is standard mechanism for AS3 events.
Cairngorm events inherit from Event and Event class requires a "type" string. That's why you need to specify it in the constuctor.
When creating a custom event class, you need to override the clone method. This method is automatically called by the Flash Player when you want to re-dispatch an instance of a custom event.
精彩评论