Created
January 23, 2018 00:46
-
-
Save sunho/db27ec59148efbac903d1b139b1aec80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function click(frame:Number) { | |
return function(e:MouseEvent) { | |
if(e.target.currentFrame == 1) { | |
e.target.gotoAndStop(frame); | |
} else { | |
e.target.gotoAndStop(1); | |
} | |
} | |
} | |
button1.addEventListener(MouseEvent.CLICK,click(2)); | |
button2.addEventListener(MouseEvent.CLICK,click(2)); | |
button3.addEventListener(MouseEvent.CLICK,click(3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment