tags:

views:

119

answers:

1

Hi,

I was going through this article by David Tucker (http://www.davidtucker.net/2007/10/29/cairngorm-part-3/) in which he 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

A: 

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.

PeZ