1 Reply Latest reply on Apr 17, 2008 7:15 AM by Newsgroup_User

    Inert Button

      Hiya i need a piece of lingo code that can make a button inert, in other words once i have pressed on it and its taken me to that page, i cannot press it again. So it becomes inactive until i press another button which takes me to another page. thanks in advance
        • 1. Re: Inert Button
          Level 7
          You would set a property to act as a switch. The switch starts off
          active, then when the button is pushed, it sets itself to inactive.
          Then, when or if you want it to become active, you send the sprite a
          message to activate it. In my example below, if the button was in
          sprite channel 1, then you could use the following commands:

          sendAllSprites(#makeActive,1) --activates sprite 1
          sendAllSprites(#makeInactive,1) --deactivates sprite 1

          Put whichever command is appropriate to activate or deactivate the
          button if you need to. If you leave the page that the sprite is on,
          then re-enter it, it will be automatically reactivated (on it's
          beginSprite() event).

          ---START HERE
          property pActive

          on beginSprite me

          on makeActive me,vSpriteNum
          if vSpriteNum=me.spriteNum then
          end if

          on makeInactive me,vSpriteNum
          if vSpriteNum=me.spriteNum then
          end if

          on mouseUp me
          if pActive then
          --do whatever it is that the button should do
          end if
          --END HERE