My question is about the stacking order of movie clips. I have ButtonA inside MovieClipA. Is it possible to assign an action to ButtonA that brings MovieClipA to the front if it's under, say, MovieClipB? Thanks in advance for any tips!
The reason I went for it was just because it was almost certain to be a higher level than anything else in Sarak's movie. To be honest "5" would probably have done it but I wanted to be sure that we got the right result.
To keep things easy to follow in my own scripts I put the clip that I always want on top at depth 1000 within the onClipEvent(load), this is especially useful in games with a lot of duplicated elements flying around.
Do you also know a way to make sure it always is on the top of the stack. I'll try to explain what I mean.
I'm making a website where everytime a user clicks a button,a different window opens (read:a different movie is being loaded). The user can leave the window open or close it. If he leaves it open and clicks another button, a new window should open on top of the stack. Thereby creating cascading windows. Since I don't know in which order the buttons are going to be clicked, I don't know on which level to open the new window. Also, If different windows are open, the users should be able to click a window which is in the background thereby moving it to the front. (kinda like when you open different pictures at the same time in photoshop)
I'd create a variable called "top" set to a high number. Whatever button is clicked, have it trigger this action:
this.swapDepths(top);
The clip will assume that level and will swap depths with the clip that was already there so your current clip will always go to the top and the clip that was last at the top will go to the depth that the current clip was on.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.