Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swapdepths? trying to keep my clips layered properly

Status
Not open for further replies.

artguy

Technical User
Feb 2, 2001
117
US
I have a (seemingly) simple layout of an image with 3 links floating in front of it. When loaded, the first link is hilighted and the appropriate picture and caption displays beneath it. When you scroll over the next link, the first image is scaled and the _alpha fades to 0% to reveal the image corresponding to the link you just moused over.

I thought I had this working using swapdepths, but I cannot keep the order so that it moves the correct image to appear beneath the image that is fading away as described above.

If anyone has a fresh idea of how to accomplish this as simply as possible, I'd appreciate it.

Thanks,

Bob
 
So what's happening? The new image appears over the previous fading one? What if you don't use swapdepths?

Regards,
new.gif
 
Now that I look at it again, I'm closer than I had thought. The links are listed above one another. The first is highlighted by default. When I scroll over any link underneath the one selected, it works perfectly---the image above fading and revealing the image beneath.

When I mouse over a link ABOVE the one that is highlighted, the new image comes to very top of the stack and the image to fade is underneath so you can't see it fading. I need to get the new movie clip to come directly beneath the old clip, somehow.

I certainly don't have to use swapdepths. I just couldn't think of any other way. Currently, I'm swapping the new mc's depth with the current and then swapping again in hopes it would bring the new movie to the top and then swap the old movie back to the top to fade. Which it does do it but only as I had described above.

thanks for listening.

Bob
 
Now that I look at it again, I'm closer than I had thought. The links are listed above one another. The first is highlighted by default. When I scroll over any link underneath the one selected, it works perfectly---the image above fading and revealing the image beneath.

When I mouse over a link ABOVE the one that is highlighted, the new image comes to very top of the stack and the image to fade is underneath so you can't see it fading. I need to get the new movie clip to come directly beneath the old clip, somehow.

I certainly don't have to use swapdepths. I just couldn't think of any other way. Currently, I'm swapping the new mc's depth with the current and then swapping again in hopes it would bring the new movie to the top and then swap the old movie back to the top to fade. Which it does do it but only as I had described above.

thanks for listening.

Bob
 
(sorry about the double post)

Here is my code to help clarify my ramblings:

//make sure it isn't the current movie
if (curMC != "2") {
//returns mc to original spot (not sure if it is necessary, but precautionary)
_root.mc2.gotoAndStop(1);
//remember which movie was on top
oldMC = curMC;
//update current mc to be this one
curMC = "2";
//hopefully, take the new mc and move above all others (you don't notice it)
_root["mc" + curMC].swapdepths("mc" + oldMC);
//move old mc back to the top to allow it to fade
_root["mc" + oldMC].swapdepths("mc" + curMC);
//play the mc fade
_root["mc" + oldMC].gotoAndPlay(2);
}

stop ();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top