0 Replies Latest reply on Feb 27, 2007 10:37 AM by BernhardSnizek

    addEventListener works only on new buttons

    BernhardSnizek
      Hi,

      I want to hook up an existing button to my code. I drag a button to the canvas, call it zoomin. My code in my app looks like this:

      var zoominBtn:Button;
      zoominBtn = _root.zoomin
      zoominBtn.addEventListener("click", method);

      Does not work.

      When I create a button like this:

      var zoominBtn:Button;
      zoominBtn = tools_mc.createClassObject(Button, "zoomin", 0);
      zoominBtn.addEventListener("click", method);

      It works wonderfully.

      Any idea ?

      Cheers

      B.