23 September, 2008

addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
 
function onLoop(evt:Event):void {
    // sort the boxes array by the x property
    // of each clip
    boxes.sortOn(“x”, Array.NUMERIC);
 
    // make sure the first box always eases to
    // the same position (50, 200);
    boxes[0].x += (0 - boxes[0].x) / 2;
    boxes[0].y += (0 - boxes[0].y) / 2
    boxes[0].currentIndex.text = 0;
   
    // align boxes
    for (var i:int = 1; i

The Power of Relative Positioning at Learning ActionScript 3.0