views:

61

answers:

1

I want to do a effect like the switching windows from Win 7 [Win]+[Tab] keys pressed. I created two "windows" (movie clips) and when I click on the 1st it displays on top of the other, but the problem is when I click on the 2nd I can see the 1st one displayed in it. Is there any way that i put a movie clip on top of the other.

Thanks

A: 

If you're using AS2, you can use the MovieClip.swapDepths() method to move one clip in front of the other. The clips will need some solid fill, though, otherwise you'll see right through them!

For example:

//Make two clips:
this.createEmptyMovieClip("clip1", 1);
this.createEmptyMovieClip("clip2", 2);

//Draw a coloured rectangle in each:
drawRect(clip1, 0xFF0000);
clip1._x = 50;
clip1._y = 50;
drawRect(clip2, 0x0000FF);

//Add a mouseclick handler
//(you could change this to a keypress handler)
clip1.onRelease = function() {
    //SWAP THE DEPTHS OF TWO CLIPS:
    clip1.swapDepths(clip2);
};

clip2.onRelease = function() {
    clip2.swapDepths(clip1);
};

function drawRect(mc, colour) {
    mc.beginFill(colour);
    mc.moveTo(100, 100);
    mc.lineTo(100, 200);
    mc.lineTo(200, 200);
    mc.lineTo(200, 100);
    mc.lineTo(100, 100);
    mc.endFill();
}
Richard Inglis
thank you...but this will not help. I will have 5 or so different movie clips with background, image and text. They will stay aligned in a position that i find suitable, until the functions to move and appear closer. The problem is that the last movie clip always stays on top, and the others work too, but stay behind the aligned movie clips. I need a function to work along the other functions I am writing to my movie clip:"stop ();this.onEnterFrame = function(){if(rewind == true){prevFrame();}} this.onRollOver = function(){rewind = false;play();}this.onRollOut = function(){rewind = true;} "
Remus Rigo
Just so I understand: do you need to cycle through all 5 clips in order (Like shuffling a deck of cards)? Or do you need whichever clip is clicked to rise to the top?
Richard Inglis
when i click on a clip i want it to raise to the top
Remus Rigo