Return to Snippet

Revision: 22561
at January 15, 2010 11:52 by arpit


Initial Code
import com.greensock.*;

function tweenElements(arr:Array, last:Boolean){
    var tweens= [];
    for(var i=0; i<arr.length; i++){
        var tgt = arr[i];
        var mult = i%2==0?1:-1;
        tgt._alpha = 0;
         t = TweenLite.to(tgt, .5, {_x:getTX(tgt, mult), _alpha:100, onStart:onAnimStart, onStartParams:[tgt,i, mult], delay:.2*i, onComplete:function(){
           if(last) return;
           setInterval(function(){
               var t2 = tweens.shift()
               t2.reverse();
           }, 2000);
           
        }});
        tweens.push(t);
        
        if(last){
            TweenLite.to(bottombar, .5, {_y:235.5, _alpha:100, onStart:function(){
                bottombar._visible = true;
            }, delay:2})
        }
        
    }
}



var tgtX;
function getTX(tgt, mult){
    tgtX = tgt._x;
    tgt._x -= mult*40;
    return tgtX;
}

Initial URL

                                

Initial Description
fades in and moves UI Elements from opposite sides towards their final positions.

Initial Title
Cool Animation Effect

Initial Tags

                                

Initial Language
ActionScript