5 Replies Latest reply on Feb 23, 2014 3:49 PM by kglad

    Show on a Text Field the number of time we click a Butoon

    ASilva Level 1

      Hi there ... i have been doing some works ... and my teacher told me to do a exercise ... but i am only ask for your opinion and help


      So here the problem ... i managed to create a code to print text as soon as i click the butoon, here it is:



      botao.addEventListener(MouseEvent.CLICK, mostrartexto);
      function mostrartexto(event:MouseEvent){
                caixadetexto.text = "Hi there World";


      So the thing now is ... that ... instead of showing the text by cliking the botoon i need to click the butoon and it must show the number of times i clicked it on the text field.


      Meaning that ... i Click it will show me "1" or "1 click", "2" or "" clicks ... and so on.


      So if there is someone who could help me and explaing how to do it ... or if it even is possible


      Regards ASilva