1 Reply Latest reply on Oct 1, 2007 5:36 AM by chris.huston.t10

    knowing which button is clicked

    kittuokkade Level 1
      i have code that creates button objects ,stores them in array and adds action listeners as follows.i want to code clickstart such that i can change the label of the clicked button.

      var buttonlist=new Array();
      for(var i:int=0;i<10;i++){
      mybutton=new Button();
      mybutton.x=10;
      mybutton.y=10+50*i;
      mybutton.width=50;
      mybutton.height=50;
      mybutton.label="no:"+i;
      mybutton.addEventListener(MouseEvent.CLICK,clickStart)
      mycanvas.addChild(mybutton);
      buttonlist.push(mybutton);
      }
      thank you