开发者

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-

  1. What is the significance of calling the constructor of the parent class with the event arg? super(LOGIN) in the example

  2. 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.

  1. Cairngorm events inherit from Event and Event class requires a "type" string. That's why you need to specify it in the constuctor.

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜