Answered
+1 and -1
Hello, Can you help me? How to do this:
- I have text field which is 0 by default (score_txt)
- Two buttons +1 and -1 (plus_btn and minus_btn)
- When I press +1 text increases by one, and when i press -1 it decreses
Thank you!
Hello, Can you help me? How to do this:
Thank you!
plus_btn.addEventListener(MouseEvent.CLICK,plusF);
minus_btn.addEventListener(MouseEvent.CLICK,minusF);
function plusF(e:Event):void{
score_txt.text=String(Number(score_txt.text)+1);
}
function minusF(e:Event):void{
score_txt.text=String(Number(score_txt.text)-1);
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.