3 Replies Latest reply on Jul 14, 2010 5:15 AM by sal_sal86@hotmail.com

    Mouse Event problem

    sal_sal86@hotmail.com

      Hi all,

       

      I have a ready simple calculater design.

      and i learned the Action Script languge last month

      i just tried to add a Mouse Lestiner for a buttons(actually it's not button but it customized to act like a button = the No. ZERO button = num0_btn as shown in the code below. )

      but it doesn't work.

       

      it works correct with the normal button ( = tst_btn ) as shown in the code below.

       

      and this is the code:

      ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------------

      var num0_btn:mx.controls.Button;

      var tst_btn:mx.controls.Button;

       

      var btnListener:Object = new Object();

       

           btnListener.click = function(evt:Object)

             {

                //do something
                 trace("there is a button pressed");

              }

       

      num0_btn.addEventListener("click", btnListener);
      tst_btn.addEventListener("click", btnListener);

      ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ ---------------------------------

      Hoooooooooope to help me please. as soon as possible.

      thx all,...................................................................................Clip.jpg