Skip navigation
FelipeDrumond
Currently Being Moderated

How send layer do back or front

May 24, 2006 10:40 AM

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" ?
 
Replies
  • Currently Being Moderated
    May 24, 2006 10:44 AM   in reply to FelipeDrumond
    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" ?
    >


     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2006 12:04 PM   in reply to Newsgroup_User
    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!


     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2006 1:18 PM   in reply to Newsgroup_User
    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".


     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points