import SomeEvent; /** Example of using the setting "Distinguish event handlers". This documentation page was created with the prefixes on, while in the input field. Note the field header "Events broadcast to listeners": the sends tag descriptions are copied automatically from the method descriptions.
You don't need to write @sends tags in the class description yourself!
@author Arthur Clemens @version 5 December 2006 */ class EventHandlersExample { /** This method does not receive an event, but sends one. In this example the method uses broadcastMessage to send the message. The # character is used as separator between method and comment. @sends onChanged(changedField:TextField):Void # When the selection is changed by the program. */ public function method_A () : Void { broadcastMessage("onChanged", changedTextField); } /** This method sends the same event as method_B. This tag is listed separately in the class description because the comment is lacking here. @sends onChanged(changedField:TextField):Void */ public function method_B () : Void { broadcastMessage("onChanged", changedTextField); } /** Testing to check if this sends tag is not listed double in the class description. @sends onChanged(changedField:TextField):Void */ public function method_C () : Void { broadcastMessage("onChanged", changedTextField); } /** The sends tag can be used with dispatched events as well. @sends SomeEvent#QUEUE_STOPPED - when a change of focus is detected */ public function method_D () : Void { dispatchEvent(new SomeEvent(this, SomeEvent.QUEUE_STOPPED)); } /** Using dispatchEvent with a generic object @sends Object#message */ public function method_E () : Void { var eventObj:Object = {target:this, type:"message"}; dispatchEvent(eventObj); } /** Automatically filling in "Object of type"... The code in this method is dispatchEvent({type:"click"}); @sends #click */ public function method_F () : Void { dispatchEvent({type:"click"}); } /** A method that starts with "on" in lowercase, followed by an uppercase character. This is the default way of writing ActionScript event handlers. Some MM classes also use the prefix "allow". */ public function onData (o:Object) : Boolean { // } /** If you want to use other prefixes for event handlers, add the prefix to the field next to "Prefixes". Separate each prefix with a comma. In this case the input field contained on, while. Spaces in between the prefixes do not matter. */ public function whileSomethingElse (o:Object) : Boolean { // } }