[AS3 SNIPPET] One listener for multiple events
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | mc.addEventListener(MouseEvent.CLICK, mc_eventHandler); mc.addEventListener(MouseEvent.ROLL_OVER, mc_eventHandler); mc.addEventListener(MouseEvent.ROLL_OUT, mc_eventHandler); function mc_eventHandler(event:MouseEvent):void { switch (event.type) { case MouseEvent.CLICK : // click code break; case MouseEvent.ROLL_OVER : // rollover code break; case MouseEvent.ROLL_OUT : // rollout code break; } } |
[AS3 SNIPPET] One listener for multiple events http://hex.io/186p #actionscript #as3
This comment was originally posted on Twitter
One listener for multiple events #pji #as3 #flash http://bit.ly/paNgk
This comment was originally posted on Twitter
Avoid this at all costs, don’t go down that rabbit hole. RT @pjinteractive: One listener for multiple events #as3 #flash http://bit.ly/paNgk
This comment was originally posted on Twitter
[AS3 SNIPPET] One listener for multiple events http://hex.io/186p
This comment was originally posted on Twitter
Avoid this at all costs, don’t go down that rabbit hole. RT @pjinteractive: One listener for multiple events #as3 #flash http://bit.ly/paNgk
This comment was originally posted on Twitter