PDA

View Full Version : puting movie clips to highestdepth



cosmicloverocks
June 30th, 2006, 10:35 AM
how can i get a movieclips into the highest depth when you roll over a mouse what what is the method?

Ordinathorreur
June 30th, 2006, 10:38 AM
I'm pretty sure this works, but I didn't test it

myMovieClip.swapDepths(getNextHIghestDepth());

p_due18
June 30th, 2006, 10:52 AM
If find this works:

FRAME SCRIPT:
_global.mySwapDepth = 0;

MOVIECLIP SCRIPT:
on(rollOver){
this.swapDepths(_global.mySwapDepth+1);
_global.mySwapDepth = _global.mySwapDepth+1;
}

Jpao17
June 30th, 2006, 12:49 PM
Because of the way Flash handels depth with its V2 Components, Its good practice to create your own function that handels depth.

var vdepth:Number = -1;
function depth() {
vdepth++;
return vdepth;
}

thats a good way to handel it in AS1, that way, instead of using this.getNextHighestDepth(), use depth(), and that will always spit out 1 higher than anything else on your timeline.

Using this in answer to your question is just how ordinathorreur mentioned,

myMovieClip.swapDepths(depth());

Chris