Can you think of an easy way to convert this to AS3? '3D' Depth swapping

swapDepths(Math.round(this._xscale) + 100);
//this is for a pseudo-3D effect, the standard cliche carousel.
//It keeps things visually layered properly.

… thoughts?

So, I guess the obvious first thing is that _xscale is now scaleX, but the bigger question is - now that we can’t arbitrarily set things to non-existent depths, this needs to be much more precise.

Ideas? I’m like [—] far from just jamming a bunch of empty sprites in there. :expressionless:

edit: Got it working with the following:


private function setDepths(e:Event = null):void
{
	_items.sortOn("scaleX", Array.NUMERIC | Array.DESCENDING);
	
	for(var i:int = 0; i < numOfItems; i++)
	{
		setChildIndex(_items*, numOfItems)
	}
}