2 Replies Latest reply on Dec 8, 2007 4:49 AM by Newsgroup_User

    Extremely stupid question - hide/show sprite

    Eolen
      I have some rollover buttons that sit on top of the background in my scene. I want the buttons to be visible when you roll over them, and invisible when you roll out. Here's my lingo, it doesn't work. It seems to work fine for the beginsprite and the mouseleave, but it doesn't work for the mouseEnter. I tried mouseWithin and it still doesn't work. Any suggestions would be greatly appreciated

      quote:

      on beginsprite me

      sprite(me.spritenum).visible = false

      end beginsprite


      on mouseEnter me

      sprite(me.spritenum).visible = true

      end mouseEnter


      on mouseLeave me

      sprite(me.spritenum).visible = false

      end mouseLeave
        • 1. Re: Extremely stupid question - hide/show sprite
          JayPay29
          Just try...

          on mouseEnter
          set the visible of sprite x to true
          end

          and

          on mouseleave
          set the visible of sprite x to false
          end

          it's should work... But i'm not an expert.. ;-)
          • 2. Re: Extremely stupid question - hide/show sprite
            Level 7
            When a sprite is set with it's .visible property to FALSE, then it is
            not there for all practical purposes. It does not get mouse events,
            thus your code will not make it visible. If you want to make the sprite
            actually be htere and repsond to mouse events, then change the .blend
            value. A .blend of 0 is invisible and a .blend of 100 is fully opaque.

            on beginsprite me
            sprite(me.spritenum).blend = 0
            end beginsprite

            on mouseEnter me
            sprite(me.spritenum).blend = 100
            end mouseEnter

            on mouseLeave me
            sprite(me.spritenum).blend = 0
            end mouseLeave