« Return to Thread: AS3 Snippets

AS3 Snippets

by Brenton Simpson :: Rate this Message:

Reply to Author | View in Thread

Hey guys,

I wrote a couple snippets for event-based programming in AS3:

-- addEventListener

addEventListener(${1:MouseEvent}.${2:CLICK}, ${3:on${2/(_)?([A-Z])([A-
Z]+)/\u$2\L$3/g}}, ${4:false}, ${5:0}, ${6:true});

-- onEventType

${1:private} function on${2:Click}(event:${3:Event}${4: = null}):
${5:void} {
        $0
}

--

I realize that addEventListener is also available in autocomplete.  
Here's why you might use it anyway:
- Chording two keys (opt-esc) for a function that is supposed to save  
you time (autocomplete) can feel clumsy.
- The tab trigger will autofill a onEventType as a callback for  
EVENT_TYPE.
- The above feature works well if you use escape to trigger naive  
autocompletion.


Thanks Simon for all your work on the AS3 bundle.  Feel free to  
include these if you find them worthy.  =)
Brenton

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

 « Return to Thread: AS3 Snippets