RE: [Flashcoders] TweenMax.allTo()
Nevermind, looks like you can only do that with the DynamicProps plug in you have to buy with a Club Greensock membership. I'll roll my own with the Timer class I guess unless someone knows of an easier way. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: Thursday, September 09, 2010 2:43 PM To: Flash Coders List Subject: [Flashcoders] TweenMax.allTo() So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx and visit our Instructional Technology Design Blog http://sharepoint.bankofamerica.com/sites/SDTeam/itdblog/default.aspx (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TweenMax.allTo()
What if you did it like this: function getRandY():Number{ var randY:Number = Math.random()*stage.stageHeight; return randY; } TweenMax.allTo(_blockViews, 1, { alpha:1, y:getRandY() }, .2); Nathan Mynarcik nat...@mynarcik.com 254.749.2525 www.mynarcik.com On Thu, Sep 9, 2010 at 2:43 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx and visit our Instructional Technology Design Blog http://sharepoint.bankofamerica.com/sites/SDTeam/itdblog/default.aspx (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TweenMax.allTo()
You could also do an onComplete call to a function that will add to a counter variable that you can then access as nameOfArray[counter] for the Y parameter. Of course, I have not used the allTo function. But this has worked for the regular to and from methods. Nathan Mynarcik nat...@mynarcik.com 254.749.2525 www.mynarcik.com On Thu, Sep 9, 2010 at 3:02 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Nevermind, looks like you can only do that with the DynamicProps plug in you have to buy with a Club Greensock membership. I'll roll my own with the Timer class I guess unless someone knows of an easier way. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: Thursday, September 09, 2010 2:43 PM To: Flash Coders List Subject: [Flashcoders] TweenMax.allTo() So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx and visit our Instructional Technology Design Blog http://sharepoint.bankofamerica.com/sites/SDTeam/itdblog/default.aspx (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TweenMax.allTo()
Because the number needs to not be random, but correspond with the item being tweened - I guess I could keep a counter and create an array of Y locations and return those, but I went ahead and just used a Timer with TweenMax.to() and a counter I incremented... works fine, I was just hoping it could be done easily with allTo() and not having to write a bunch of extra code - ; So yeah, good suggestions though, thanks! I didn't realize the property could be a function as well - great idea. I might try and use that if I get sick of the Timer class way. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan Mynarcik Sent: Thursday, September 09, 2010 3:21 PM To: Flash Coders List Subject: Re: [Flashcoders] TweenMax.allTo() What if you did it like this: function getRandY():Number{ var randY:Number = Math.random()*stage.stageHeight; return randY; } TweenMax.allTo(_blockViews, 1, { alpha:1, y:getRandY() }, .2); Nathan Mynarcik nat...@mynarcik.com 254.749.2525 www.mynarcik.com On Thu, Sep 9, 2010 at 2:43 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx and visit our Instructional Technology Design Blog http://sharepoint.bankofamerica.com/sites/SDTeam/itdblog/default.aspx (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TweenMax.allTo()
look at TimelineMax for sequencing, or do a loop through all your objects and assign them different tweens. On 9 September 2010 21:38, Merrill, Jason jason.merr...@bankofamerica.comwrote: Because the number needs to not be random, but correspond with the item being tweened - I guess I could keep a counter and create an array of Y locations and return those, but I went ahead and just used a Timer with TweenMax.to() and a counter I incremented... works fine, I was just hoping it could be done easily with allTo() and not having to write a bunch of extra code - ; So yeah, good suggestions though, thanks! I didn't realize the property could be a function as well - great idea. I might try and use that if I get sick of the Timer class way. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nathan Mynarcik Sent: Thursday, September 09, 2010 3:21 PM To: Flash Coders List Subject: Re: [Flashcoders] TweenMax.allTo() What if you did it like this: function getRandY():Number{ var randY:Number = Math.random()*stage.stageHeight; return randY; } TweenMax.allTo(_blockViews, 1, { alpha:1, y:getRandY() }, .2); Nathan Mynarcik nat...@mynarcik.com 254.749.2525 www.mynarcik.com On Thu, Sep 9, 2010 at 2:43 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx and visit our Instructional Technology Design Blog http://sharepoint.bankofamerica.com/sites/SDTeam/itdblog/default.aspx (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TweenMax.allTo()
No need to use a Timer. Wouldn't it be as simple as this?: var targets:Array = [mc1, mc2, mc3]; var positions:Array = [0, 100, 200]; var stagger:Number = 0.2; for (var i:int = 0; i targets.length; i++) { TweenMax.to(targets[i], 1, {y:positions[i], delay:i * stagger}); } If you need to control the entire sequence as a whole (pause(), resume(), reverse(), restart(), gotoAndPlay(), etc.), definitely insert() them into a TimelineLite or TimelineMax. If you aren't familiar with TimelineLite/Max, check out the brief video at http://www.greensock.com/timeline-basics/. But again, a simple loop along with the delay special property should be all you need for most situations. Jack -Original Message- From: Merrill, Jason [mailto:jason.merr...@bankofamerica.com] Sent: Thursday, September 09, 2010 1:43 PM To: Flash Coders List Subject: [Flashcoders] TweenMax.allTo() So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: RE: [Flashcoders] TweenMax.allTo()
Said from the man himself. Great suggestion! On Sep 9, 2010 6:58 PM, Jack Doyle j...@greensock.com wrote: No need to use a Timer. Wouldn't it be as simple as this?: var targets:Array = [mc1, mc2, mc3]; var positions:Array = [0, 100, 200]; var stagger:Number = 0.2; for (var i:int = 0; i targets.length; i++) { TweenMax.to(targets[i], 1, {y:positions[i], delay:i * stagger}); } If you need to control the entire sequence as a whole (pause(), resume(), reverse(), restart(), gotoAndPlay(), etc.), definitely insert() them into a TimelineLite or TimelineMax. If you aren't familiar with TimelineLite/Max, check out the brief video at http://www.greensock.com/timeline-basics/. But again, a simple loop along with the delay special property should be all you need for most situations. Jack -Original Message- From: Merrill, Jason [mailto:jason.merr...@bankofamerica.com] Sent: Th... Subject: [Flashcoders] TweenMax.allTo() So in Greensock's TweenMax, you can tween and stagger (dela... ___ Flashcoders mailing list flashcod...@chattyfig.figle... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TweenMax.allTo()
Ah, thanks Jack. I didn't realize there was a delay property... I could have found that with code hinting if I had dug a little deeper. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jack Doyle Sent: Thursday, September 09, 2010 6:59 PM To: 'Flash Coders List' Subject: RE: [Flashcoders] TweenMax.allTo() No need to use a Timer. Wouldn't it be as simple as this?: var targets:Array = [mc1, mc2, mc3]; var positions:Array = [0, 100, 200]; var stagger:Number = 0.2; for (var i:int = 0; i targets.length; i++) { TweenMax.to(targets[i], 1, {y:positions[i], delay:i * stagger}); } If you need to control the entire sequence as a whole (pause(), resume(), reverse(), restart(), gotoAndPlay(), etc.), definitely insert() them into a TimelineLite or TimelineMax. If you aren't familiar with TimelineLite/Max, check out the brief video at http://www.greensock.com/timeline-basics/. But again, a simple loop along with the delay special property should be all you need for most situations. Jack -Original Message- From: Merrill, Jason [mailto:jason.merr...@bankofamerica.com] Sent: Thursday, September 09, 2010 1:43 PM To: Flash Coders List Subject: [Flashcoders] TweenMax.allTo() So in Greensock's TweenMax, you can tween and stagger (delay) the tweens of multiple sprites at once, via giving a method like, allTo an array of objects (in this example, _blockViews): TweenMax.allTo(_blockViews, 1, { alpha:1, y:150 }, .2); However, this assumes you want all the tweens to tween to the same property value. What if I wanted all the objects to end up at various Y locations instead of 150? As it is in the code above, they all tween to y=150. Is there a way to provide an array of y locations that each object moves to and have then staggered (as you can with the allTo() method)? I can of course accomplish this by writing some Timer event code to tween each object individually and accomplish what I want - ending up at varying Y locations, but I'd rather not have to write all that code - shouldn't there be a way to do this with TweenMax's sequencing capabilities? Would this be a case where you would use TimelineMax and append several tweens? If so, how would you also stagger them? Jason Merrill ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders