actionscript 3 - Flash Builder Code completion for events -
when i'm using built-in eventdispatcher
code completion show list of events fired class, example:
how can achieve same own classes, example might extend event class this:
import flash.events.event; public class myevent extends event { //event types public static const first_event:string = 'firstevent'; public static const second_event:string = 'secondevent'; //construct public function myevent(type:string, bubbles:boolean=false, cancelable:boolean=false) { super(type, bubbles, cancelable); } }
and might write eventdispatcher
this:
import flash.events.eventdispatcher; import flash.events.ieventdispatcher; public class myeventdispatcher extends eventdispatcher { public function foo() :void{ dispatchevent(new myevent(myevent.first_event)); } public function bar() :void{ dispatchevent(new myevent(myevent.second_event)); } }
what can make events appear in code completion box?
i aware can use metadata above class, this:
[event(name="firstevent", type="my.myevent")] [event(name="secondevent", type="my.myevent")]
but mxml, , code completion knows string value ("firstevent"
), not const (myevent.first_event
).
i using flash builder 4.7.
Comments
Post a Comment