
When making complex maps out of tiles, the limitations of the current z-ordering system are the bane of my life. What I'm looking for is a script by someone good at graphics math that will let me do "send 1 step backwards" on a given graphic object. It will find all the other graphics that the selected graphic overlaps with, calculate a new z-order that puts the selection immediately behind the next one back, and then put this into action using toFront() and toBack(). I guess naively it could just calculate the complete new z-order for the page and then make it so by calling toFront() on each one starting from the back... but someone better at maths than me can probably work out a more optimised approach to changing the z-order using just those two operations... Any takers? Surely someone like Stephen S. or TheAaron has already written this code somewhere?