The Central Ohio Gamedev Group Message Board › Help with AS2 repeatedly depth sorting array of moving movie clips

Help with AS2 repeatedly depth sorting array of moving movie clips

Alan M.
user 5794556
Galloway, OH
Post #: 22
I'm trying to do an AS2 joke animation reminiscent of the old Windows 3.1 "Flying Windows" screensaver:
http://www.youtube.co...­

I've got the motion down, and I can sort the array prior to any movement, no problem. Then I march through the array and add 5 to the z location of everything. But once the nearest object reaches 0 on the z axis (nearest the screen) and gets "wrapped around" to a new starting point on the -z axis (furthest from the screen), I'm having brain lock on how to get Flash to adjust movie clip depths appropriately, so distant objects are often seemingly atop nearer objects. Suggestions?
Steve C.
ColumbusSteve
Powell, OH
Post #: 43
Can you post your code?
Alan M.
user 5794556
Galloway, OH
Post #: 23
Alan M.
user 5794556
Galloway, OH
Post #: 24
I got it working (the act of posting the question got my mind going in the right direction, it seems).

Previously I was under the mistaken impression that .swapDepths() forced you to designate another movieclip as your movie clip's "dancing partner" when the swap took place. A closer look at the docs showed that you can alternatively supply an arbitrary number. So I can just reassign the whole lot of them new depths every frame.
Powered by mvnForum

Our Sponsors

  • Unity 3D

    They help fund our bi-yearly Meetup organizer fees.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy