Last active
December 12, 2015 05:29
-
-
Save FrancescoMaisto/4722381 to your computer and use it in GitHub Desktop.
Extends the standard Starling Button by adding an id parameter.
The id parameter can then be retrieved from the event dispatched to the 'onButtonTriggered' listener. (see usage example in the first comment)
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extends the standard Starling Button by adding an id parameter. The id parameter can then be retrieved from the event dispatched to the 'onButtonTriggered' listener. For example:
private function onButtonTriggered(event:Event):void { var button:IdButton = event.target as IdButton; var buttonName:String = button.name; var id:uint = button.id; // Perform different actions based on buttonName and id if (buttonName == "backButton") showScreen(id); else if (buttonName == "clickedLevel") startLevel(id); }