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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

swapDepth

Status
Not open for further replies.

bugg

Programmer
Jun 20, 2001
62
US
I have a series of dragable, scaleable images on my stage, an I am having trouble with them covering each other up. swapDepth works with images that are all within the same parent movie, but if they are in different parent movies, it doesn't work, any ideas (Aside from putting them all in the same parent movie?)

here is the function used to swapDepths:

function startdrg (img,pic) {
img.swapDepths( 500 );

img.gotoAndStop (1);
startDrag (img, false, -756, -555, (-90-(pic._width-74)),(-125-(pic._height-120)));
};

the images ("img" in the function) reside in the following MC tree:

_root
icons
rbicons
res

img1
img2
img3
img4

plaz

imgA
imgB
imgC
imgD

imgs 1,2,3,4 all swapDepths with each other fine, as do A,B,C,D but just not with each other (1&A,2&D,etc.)

thanks much
bugg
 
analyze your processing bugg, on startDrag(), the depth of each that was being dragged was changed to a fixed value(500), thus creating an error of having all these movies being set with the same depth value.

That is, what you should do is that to reset their original depth value after they were dropped from being dragged. Thereby making it that the depth value 500 is assigned only to the currently being dragged movie instance.

have a smooth one,
Shane54
 
That's not how swapDepths() works Shane - the clip that was at depth 500 is placed at the depth last occupied by the clip that is now being set to 500. The clips actually swap places.

I don't think there's a way to programatically get around the problem of having clips swap depths in separate movies because of the way the internal layer stack works in the Flash Player.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top