3 Replies Latest reply on Apr 19, 2006 8:02 PM by Newsgroup_User

    Sprite Visible

    bmohnsen3 Level 1
      I have a script that checks for the visibility of checkboxes -- then it goes to the next marker
      go "Plan1"
      cursor -1

      Now it sets the visibility of certain pictures based on which checkboxes were selected.

      Problem: it sets the visibility of sprites on the original screen also.
      Shouldn't it only set the visibility of the sprites on the new screen - since I have used go "plan1" to get to the new screen
        • 1. Re: Sprite Visible
          Level 7
          The visible property belongs to the sprite channel, not the item that
          currently occupies the sprite channel. So, if you set a sprite channel
          to be not visible, it will stay not visible until you tell it to be
          visible again.

          You may want to use the blend property instead, this property belongs to
          the individual element in the sprite channel, not the channel itself.
          Be aware that if a sprite's blend value is set to 0, it is still an
          active sprite and any code attached to it will work. So a cursor change
          will still show if the user slides the cursor over that hidden sprite.
          This will not happen if you use the visible property.

          Rob Dillon
          Adobe Community Expert

          • 2. Re: Sprite Visible
            Level 7
            A 3rd commom scheme for hiding sprites is to relocate it off screen,
            rollover scripts don't get triggered and some animations might run
            quicker without running over phantom 0 blend sprites.

            sprite(10).locV = sprite(10).locV - 9000

            shifting off screen a relative amount allows one to restoe the original
            location with an inverse calculation.

            Here'e a self restoring scheme

            seldSprite 10, #unhide

            -- sprite 10 behavior

            on unhide me
            if sprite(me.spriteNum).locV < -8000 then -- yes I am hidden
            sprite(me.spriteNum).locV = sprite(me.spriteNum).locV + 9000
            end if
            • 3. Re: Sprite Visible
              Level 7
              JB provided a good way to hide / unhide sprites. But, there was a small

              > seldSprite 10, #unhide

              should be:
              sendSprite 10, #unhide

              Typos are the most common bug in scripts, so should always be the first
              thing to check if anything goes wrong.


              Director Lecturer / Consultant