Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// clickType declared elsewhere in code.
- checkBoxFast.addEventListener(clickType, goFast("yes"));
- function goFast(evt:Event=null,myVar:String)
- {
- trace(myVar);
- }
- checkBoxFast.addEventListener(clickType, function(e:Event):void{goFast("yes")});
- function goFast(myVar:String)
- {
- trace(myVar);
- }
- public class MyEvent extends Event {
- public var myVar:String;
- public function MyEventHistoryEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) {
- super(type, bubbles, cancelable);
- }
- }
- var event:MyEvent = new MyEvent("eventType");
- event.myVar = "yes";
- dispatchEvent(event);
- checkBoxFast.addEventListener("eventType", eventHandler);
- protected function eventHandler(event:MyEvent):void {
- trace(event.myVar);
- }
- public function test() {
- var myVar : String = "some value";
- addEventListener(MouseEvent.CLICK, onClick);
- function(e:Event){
- trace(myVar);
- }
- }
Add Comment
Please, Sign In to add comment