2 Replies Latest reply on Apr 19, 2006 12:10 PM by Newsgroup_User

    arranging sprite order in an if statement - help

    P2Vulco Level 1
      hi,
      does anybody know how to arrange the sprite order on stage using lingo?

      basically i have a button that i want to disable or enable using the if statement.

      thanks

      andy
        • 1. Re: arranging sprite order in an if statement - help
          Level 7
          I'm not understanding the sprite order question.

          For the second, you can create a boolean property in one sprite's
          behavior and then change the value of that property from another
          sprite's behavior. For instance:

          for the sprite that you want to control:

          ---------
          property allowMe
          property thisSprite

          on beginSprite me
          thisSprite = me.spriteNum
          allowMe = true
          end

          on mouseUp me
          if allowMe then
          -- your conditional statement here
          else
          -- some other action
          end if
          end

          ------

          and then for the sprite that you want as the control:

          -------
          property thisSprite
          property spriteToControl

          on getPropertyDescriptionList
          myPropList = [:]
          myPropList.addProp(#spriteToControl,[#comment:"enter the number of the
          sprite to be controlled:",#format:#integer,#default:""])
          return myPropList
          end

          -- this function will toggle the allowMe property of the other sprite
          off and on
          on mouseUp me
          if sprite(spriteToControl).allowMe = true then
          sprite(spriteToControl).allowMe = false
          else
          sprite(spriteToControl).allowMe = true
          end if
          end
          --------

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: arranging sprite order in an if statement - help
            Level 7
            You can overide the natural sprite channel layining by changing the locZ
            property of a sprite