Jump to content


Layer order problem


  • You cannot reply to this topic
1 reply to this topic

#1 Moordziek

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 14 July 2007 - 07:23 AM

Hi guys (and girls :rolleyes:)

Im having a lil problem and was hoping that someone here would know the awnser.

Im trying to let layers overlap each other

Layerorder

as you see now, i made a button for the red and the blue square. If you press one of the buttons i want it to come on top of the other. This way i can make nice animations for a website when you go to a other page.

Layerorder .fla + swf file

I hope someone here is able to help me ^^ ty in advance

Greetingz, Moordziek

Edited by Moordziek, 14 July 2007 - 07:26 AM.


#2 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 15 July 2007 - 08:41 PM

Use the swapDepths(); method on the movie clips.

I'm assuming your blue/red squares have instance names, so you can do

// on the blue square button
if(blueSqauare_InsatnceName.getDepth < redSqauare_InsatnceName.getDepth){
blueSqauare_InsatnceName.swapDepths(redSqauare_InsatnceName);
}

That should swap the depths. You'll need to add the correct reference path to the instance name, and apply the same code to the red button, but change the < sign to a > sign.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users