Swap Depth Improvment

I modified Kirupa’s Swap Depth tutorial FLA. I added a menu system to open the windows, a transparances swap form foreground to background windows, and exit buttons to close the windows. Could you moderators check out my code and see if there is a less “IF Statement” heavy way to achive this effect? This was the best way I knew how. I hope to use this code in my new portfolio page and would like your comments.:slight_smile:

PS. Big thanks to Kirupa for providing such a great FLA to start with. I hope he doesn’t mind my changes.

Hey… I found the thread.

I’ll be happy to take a look at this today… probebly wont have any answers for you till tonight though.

There’s an error in the tutorial. The x=0; and then x=x+2; is incorrect. Instead you should have a global variable topLevel in the _root, and increment it when you swapDepths.

Yeah, that’s about as unclear as I can be. :stuck_out_tongue: I’ll try and ‘correct’ your fla.

pom :asian:

There you go. I changed quite a few things:

  • I removed the variables blueopen, etc. because they are redundant with the _visible property of the clips
  • I took a bunch of tests out.

Post if you have questions.

pom :asian:

Thanks ilyaslamasse.:slight_smile:
I always manage to over think things and put to much code into my projects(ans you could see). You are so right to have the alpha changes to happen wheather the window is open or not. If its not open its not visible so it its not going to matter DUh. I knew I didn’t need so may if statments so thats why I posted and you have showing me the light. The old x variable for the swap depth was from kirupas tutorial so I didn’t want to mess with it but yor way is much safer to have that variable defined in the first frame. Again Big thanks to you this new code is just great.

Thnaks David:)
I’m so sorry that the link didn’t work in the PM I sent. You really didn’t have to go throug the trouble of finding it on your own. You have went beyond the call of duty on this one. I would still love to see what you can come up with from the code. Thats if you still want to of course.

PS. Every one who has helped will get a big Thank you and mention on this project when I get it finished with out you guys an Kirupa I would be lost. Thank you so much:)