5 Replies Latest reply: May 24, 2006 1:18 PM by Newsgroup_User RSS

    How send layer do back or front

    FelipeDrumond
      Hello guys! How can I make a "bring to front" with a layer in run time? I can make this in design time, but I need make this in run time, because I need have this functionality in a application for kids that a child can alter objects position.
      Ex.:
      Layer "A" contains a picture
      Layer "B" contains a text
      In design time, layer "A" is over layer "B". How can I change this in run tim, making layer "B" over layer "A" ?
        • 1. Re: How send layer do back or front
          Newsgroup_User Community Member
          You can exchange their locZ's your you could swap images within the members.
          But swapping locz's is easiest. You can also just change the locZ to some
          numbers that won't conflict with other sprite numbers that are in use.

          --
          Craig Wollman
          Word of Mouth Productions

          phone 212 928 9581
          fax 212 928 9582
          159-00 Riverside Drive West #5H-70
          NY, NY 10032
          www.wordofmouthpros.com


          "FelipeDrumond" <webforumsuser@macromedia.com> wrote in message
          news:e525q3$ag4$1@forums.macromedia.com...
          > Hello guys! How can I make a "bring to front" with a layer in run time? I
          > can
          > make this in design time, but I need make this in run time, because I need
          > have
          > this functionality in a application for kids that a child can alter
          > objects
          > position.
          > Ex.:
          > Layer "A" contains a picture
          > Layer "B" contains a text
          > In design time, layer "A" is over layer "B". How can I change this in run
          > tim,
          > making layer "B" over layer "A" ?
          >


          • 2. Re: How send layer do back or front
            FelipeDrumond
            Hello Craig! Can you show me a Lingo example?
            Thank you for answer!
            • 3. Re: How send layer do back or front
              Newsgroup_User Community Member
              I don't know how the user is to initiate this action but I'll assume that
              he/she will click on one of the two sprites. Put this code on both sprites.
              I'm going to assume the two sprite channels are 15 and 16 but you should
              change the numbers below to suit your layout. Create one behavior and
              assign it to both sprites.

              on mouseUp me
              spr1 = 15
              spr2 = 16
              if me.spriteNum = spr1 then
              if sprite (me.spriteNum).locZ = spr1 then
              sprite (me.spriteNum).locZ = spr2
              sprite (spr2 ).locZ = spr1
              else
              sprite (me.spriteNum).locZ = spr1
              sprite (spr2 ).locZ = spr2
              end if
              else
              if sprite (me.spriteNum).locZ = spr1 then
              sprite (me.spriteNum).locZ = spr2
              sprite (spr1).locZ = spr1
              else
              sprite (me.spriteNum).locZ = spr1
              sprite (spr1).locZ = spr2
              end if
              end if
              end

              It seems like a lot and it might be. On the spurr of the moment, it's what
              I came up with and it works. This will swap layers regardless of which of
              the two sprites is clicked. If you want it to work differently, let me
              know.

              --
              Craig Wollman
              Word of Mouth Productions

              phone 212 928 9581
              fax 212 928 9582
              159-00 Riverside Drive West #5H-70
              NY, NY 10032
              www.wordofmouthpros.com


              "FelipeDrumond" <webforumsuser@macromedia.com> wrote in message
              news:e5287g$dek$1@forums.macromedia.com...
              > Hello Craig! Can you show me a Lingo example?
              > Thank you for answer!


              • 4. Re: How send layer do back or front
                FelipeDrumond
                Hello Craig. Thank you for atention! I´ll try your code.
                Ps.: "he/she" ? Hahaha... You can use "he".
                • 5. Re: How send layer do back or front
                  Newsgroup_User Community Member
                  That's what you think. In this overly sensitive world, he would be sexist.
                  I'm not sure if that's what's being taught today but I certainly learned to
                  use he for a singular person. Of course, using he first when using he or
                  she might be a problem as well.

                  Of course most these days would use "they" and be completely wrong but then
                  again who ever uses the plural form of "to be" anymore.

                  "There's 5 people in the elevator"-and some wouldn't even know what's wrong
                  with that.

                  makes me gag.

                  But I digress.


                  --
                  Craig Wollman
                  Word of Mouth Productions

                  phone 212 928 9581
                  fax 212 928 9582
                  159-00 Riverside Drive West #5H-70
                  NY, NY 10032
                  www.wordofmouthpros.com


                  "FelipeDrumond" <webforumsuser@macromedia.com> wrote in message
                  news:e52b4t$h13$1@forums.macromedia.com...
                  > Hello Craig. Thank you for atention! I?ll try your code.
                  > Ps.: "he/she" ? Hahaha... You can use "he".