Jump to content
GreenSock

Sinewave

Need to stagger, can't use allTo. [SOLVED]

Recommended Posts

Best if you just look. I have an array of clips I need to stagger, but there's one I need to dynamically pick to exclude.

 

function vid_btn_click(e:Event):void {
for (var v:uint = 0; v		videoButtons[v].mouseEnabled = false;
	if (videoButtons[v] != e.target) {
		TweenLite.to(videoButtons[v], .7, {alpha:0, x:"-200", ease:Cubic.easeOut});
		// TweenMax.allTo(videoButtons[v], .7, {alpha:0, x:"-200", ease:Cubic.easeOut}, .2); doesn't work
	}
}
}

 

I don't have to stagger them, but I would like to. Does anyone know a way to make it happen?

Link to comment
Share on other sites

allTo() expects an Array as the first parameter - you were passing a single object. Either of these two ways should work:

 

function vid_btn_click(e:Event):void {
  var others:Array = [];
  for (var v:uint = 0; v       videoButtons[v].mouseEnabled = false;
     if (videoButtons[v] != e.target) {
	  others.push(videoButtons[v]);
     }
  }
  TweenMax.allTo(others, .7, {alpha:0, x:"-200", ease:Cubic.easeOut}, 0.2);
}

 

-or-

 

function vid_btn_click(e:Event):void {
var count:uint = 0;
  for (var v:uint = 0; v       videoButtons[v].mouseEnabled = false;
     if (videoButtons[v] != e.target) {
	  count++;
	  TweenMax.to(videoButtons[v], 0.7, {alpha:0, x:"-200", ease:Cubic.easeOut, delay:count * 0.2});
     }
  }
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×