1 Reply Latest reply on Aug 17, 2006 11:22 PM by Opera Rat

    How do I make my button disappear?

    Opera Rat Level 1
      I have been working on this drop down menu for HOURS. I know that many of you have done this hundreds of times. I cannot get the sprite (menu item) that was chosen (clicked on) to go away. This is what I'm using on each of the sprites in a dropdown menu (except for the menu header which opens the dropdown list). Until I get my script working on an individual sprite, I'm not going to use properties to set parameters.

      on mouseWithin me
      set the member of sprite the currentSpriteNum to member "textNormal"
      end

      on mouseLeave me
      set the member of sprite the currentSpriteNum to member "TextHighlight"

      on mouseUp
      set the member of sprite the currentSpriteNum to 0
      sendSprite(sprite 31, #hidePopup)
      go to "someMarker"
      end

      hidePopup runs a handler in the menu header sprite that sets all the sprites used in the dropdown menu to zero (they disappear).

      ALL EXCEPT FOR THE SPRITE THAT WAS CLICKED ON because you are still within the sprite so it sets itself to the textNormal member instead of disappearing. How can I make this sprite go away too? I've tried on mouseEnter but it doesn't make a difference. PLEASE HELP ME. (5 hours on this problem has been enough)
        • 1. Re: How do I make my button disappear?
          Opera Rat Level 1
          I wish there was a way to delete an entire post. 10 minutes after I posted this I solved my problem. Probably in a very sloppy manner, but it works. I added:

          on mouseUp
          pClickStatus = TRUE
          sendSprite(sprite 31, #hidePopup)
          go to "q7"
          end


          on exitFrame me
          if pClickStatus then
          set the member of sprite the currentSpriteNum to 0
          else
          end if
          end

          Now I can turn this script into some Object-Oriented behavior. If anyone has any neater script, please feel free to blow mine away.