addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

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:­

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.
Blacklick, 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

  • Multivarious Games

    Support venue space, food, supplies and other game-dev opportunities.

  • Unity 3D

    They help fund our bi-yearly Meetup organizer fees.

  • The Fat Girl Bakery

    Occasionally provide cakes, cupcakes, brownies, and cookies for events.

  • Deeko

    Geeky apparel offering prizes for our game jam event, Global Game Jam.

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