Saturday, 20 August 2011

Custom Event in AS3


How to create Custom Event?

Following step to show how to create custom event

1.Extend the Event Class of flash.events.Event package

2.Call super() method with the three parameter inside the class constructor

3.Override clone() method for re-dispatch event

3.Override toString() method for trace out the event details

Example: Click the image and get downdload file




Custom Event class is useful for transfer the data from one class to another class using event dispatching concept. In my reference example XmlEvent class is a CustomEvent class. Its pass the signal with data from XmlLoader class to Main class