# Enable MCs to pass behind one another to give simple 3d effect

**URL:** <https://forum.kirupa.com/t/enable-mcs-to-pass-behind-one-another-to-give-simple-3d-effect/291716>\
**Category:** programming\
**Created:** [July 3, 2009, 4:49pm UTC](https://forum.kirupa.com/t/enable-mcs-to-pass-behind-one-another-to-give-simple-3d-effect/291716 "2009-07-03T16:49:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tech1495](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tech1495](https://forum.kirupa.com/u/tech1495)\
**Post date:** [July 3, 2009, 4:49pm UTC](https://forum.kirupa.com/t/enable-mcs-to-pass-behind-one-another-to-give-simple-3d-effect/291716/1 "2009-07-03T16:49:24Z")

</div>

Hey All,

I’m making a basic 3d platform shoot em up using ActionScript 1.0.

I need a fairly simple script (using swapdepths or something even simpler if possible) to place on a number of different movie clips (6 in total) so that when they rise up the y-axis, and when one MC rises above the other, it moves behind it to give the required 3d effect.

Example:

Elements 1 and 2 have a y-axis reading of 310 are on a lower depth to Element 3 which has a y-axis reading of 280. When Element 3 climbs the screen and reaches and surpasses 310 it should become the Element with the lowest depth.

I’m fairly new to actionscript and am struggling a little here.

All help greatly appreciated.

Rick
