Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : problem with swapDepth


chicken king
2/6/2004 9:13:21 PM
hello ou there...
i am working on a quick game and am having a problem with swapDepth [which i am using for the first time]

i am using the following code to have two objects swapDepth based on their relative _y positions:

onClipEvent (enterFrame) {
if (_root.toaster._y>=_root.app._y-10) {
_root.toaster.swapDepths(3);
_root.app.swapDepths(2);
}
}
onClipEvent (enterFrame) {
if (_root.toaster._y<_root.app._y-10) {
_root.toaster.swapDepths(2);
_root.app.swapDepths(3);
}
}

this code is working fine. the problem is that when you succeed or fail at this part of the game i want to go on to the next scene. i am going to the next scene just fine, but the toaster mc and app mc still show up in the next scene even though they are not actually in that scene of my .fla.

if someone could tell me what i am missing i would greatly appreciate it. neither flash built in help nor the flash bible are being useful on this one.

thanks in advance for help on this one.


m_ozdemir
2/6/2004 9:27:03 PM
I had the same problem. You can either set the depth back to initial value before moving to the next frame or hide them in the next frame.

chicken king
2/6/2004 9:56:21 PM
what i really need to do is just make them go away. i am not using them in the next scene. but they just wont go away. is there some variation of removeMovieClip which works for mcovie clips that have been depth adjusted. i am guessing that after the swap depth those movie clips take on a reality of their own, so now i must make them go away. help please.....

asiabackpacker
3/3/2004 11:48:45 PM
if all else fails:
AddThis Social Bookmark Button