Perspective Depth

Hey people!

I’ve been searching the forum for this, I’m almost sure I saw a thread about it somewhere but can’t find it anywhere, so exuse me if I’m duplicating another thread…

I’ve got a little problem. I started working on this game yesterday and already bumped into a problem (take a look at the screenshot). All the (for now ugly) bushes and houses are being generated with a for(i=… statement with a random position to keep the gameplay different everytime you play it. Some bushes that are further away from our perspective should be behindthe other bushes that are closer to us.

Is there anybody who knows a simple treatment to swap the depths of the movieclips which _y positions < than the _y positions of the ones closer to us??

Thanks for any thoughts/help in advance!!