1 Reply Latest reply on Apr 20, 2011 4:47 AM by Ned Murphy

    buttons

    dannyb89 Level 1

      Hi Guys/Girls

       

      i have a small problem. i have the following as2 code:

       

      stop();

       

      onMouseUp = function(){
          play();
          null;
      }

       

      This stops my presentation and then on mouse up continues all perfectly ok

       

      However on a particular screen i have website and email links but when i click these buttons the presentation continues due to the mouse up script.

       

      How could i identify when im over a button to run that script rather than the above mouseup script?

       

      Any advice would be greath, thanks

       

      Dan

        • 1. Re: buttons
          Ned Murphy Adobe Community Professional & MVP

          The "null;" line in your function isn't going to do anything.  The way you have it written, any mouseup action anywhere is going to trigger the function and make the movie play, so one way to undo that is to remove it when you rollover other objects where you don't want it activated and restore it when you rollout of them.  Something like the following...

           

          stop();

           

          function disablePlay(){
              delete onMouseUp;
          }

           

          function enablePlay(){
              onMouseUp = playMovie;
          }

           

          function playMovie(){
              play();
          }

           

          btn.onRollOver = disablePlay;
          btn.onRollOut = enablePlay;

           

          enablePlay();