1 Reply Latest reply on May 7, 2007 7:53 AM by John Hall

    Sending messages to another button

    John Hall Level 4
      Two questions. I have code in a timeline that can be minimized to something like:

      _level0.count = 0;
      button1.onRelease = function(){
      button2.onRelease();
      }
      button2.onRelease = function(){
      _level0.count = _level0.count + 1;
      trace(_level.count);
      }

      When I click on button 1, the output window displays
      1
      2

      When I click on button 2, the output window displays
      1

      Why is the button 2 event fired twice when clicking on button 1?

      Second question, can one simply call an event directly from another button or movieclip? In other words, why does the following not work in button 1:

      on (release){
      _level0.button2.onRelease();
      }

      button 2:
      on (release){
      trace("Received message");
      }

      Thanks for this basic info