Copy link to clipboard
Copied
Hi all,
I have 3 images...
I created 3 movie clips for each one (a_mc, b_mc, c_mc). It shows up as one behind the other, but what I want is to: click on the movie clip that is shown as the last one (or the second one) and have it appear at the front (a swap with the first) with a nice transition.
Thank you all.
Kglad answer:
var mcA:Array=[a_mc,b_mc,c_mc];
for(var i:uint=0;i<mcA.length;i++){
mcA.addEventListener(MouseEvent.CLICK,f);
}
function f(e:Event){
setChildIndex(e.currentTarget,numChildren-1);
}
// and you'll need to create your transition.
My Reply
Hi, Kglad...
thank you for you Help. I think that I should not have post it this under AS3... because the answer to my question actually is:
I'm still looking for the way to do it with a transition or effect.
(The effect I want is to see the transition from behind to front....)
Copy link to clipboard
Copied
I'm not completely sure what you're after here, but have a look at this example. Each of the movieClips stay in the same location, they just change depth. I added a simple fade animation for the transition. Feel free to adapt as needed.
Copy link to clipboard
Copied
Or you could look at this file: http://www.ddg-designs.com/downloads/changeDepth.zip
Copy link to clipboard
Copied
Thank you, Rob. That's perfect!
Copy link to clipboard
Copied
or check into a carousel effect. a narrow (or 0-width) carousel would make a nice transition.