1 Reply Latest reply on May 7, 2006 10:33 AM by Newsgroup_User

    Script to turn off mouse input?

    deepspacemillar
      In my director movie, i have sprites that can be clicked to perform an action through a mouseUp handler. My problem is that when a sprite is clicked, i dont want it to be clicked again until the sprite has been 'reset'. Is there a property i can change so that mouse clicks no longer apply?
        • 1. Re: Script to turn off mouse input?
          Level 7
          I like to do this by creating a sprite property.

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

          property spriteNum, pEnabled

          on beginSprite me
          sprite(spriteNum).pEnabled = true
          end

          on mouseUp me
          if sprite(spriteNum).pEnabled then
          -- Do something here
          sprite(spriteNum).pEnabled = false
          end if
          end

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


          This allows the button to be clicked once, execute whatever code you desire,
          then disabled the button from executing the code again by setting the
          button's pEnabled property to false. Some where else you can reset the
          sprite's pEnabled property back to true so that it will respond to the
          mouseUp event again.