TweenGroup - Manage Sequences and Groups of TweenLite/FilterLite/Max Tweens
- Version: 1.02, Updated 12/17/2008
- Compatibility: AS2 and AS3
- File Size added to published SWF: About 4Kb (not including TweenLite and OverwriteManager which are about another 4kb combined)
| |
|
|
Join Club GreenSock to get bonus classes, updates, and much more
SNEAK PEEK: A major update to TweenLite/Max is almost ready! Try it out and offer your input. Click here.
DESCRIPTION
TweenGroup is a very powerful, flexible tool for managing groups of TweenLite/TweenFilterLite/TweenMax tweens (and is included in each of their downloads). Here are a few of the features:
- pause(), resume(), reverse(), or restart() the group as a whole. (Tip: this is an easy way to add these capabilities to TweenLite instances without the extra Kb of TweenMax!)
- Treat a TweenGroup instance just like an Array, so you can push(), splice(), unshift(), pop(), slice(), shift(), loop through the elements, access them directly like myGroup[1], and set them directly like myGroup[2] = new TweenLite(mc, 1, {x:300}) and it'll automatically adjust the timing of the tweens in the group to honor the alignment and staggering effects you set with the "align" and "stagger" properties (more on that next...)
- Easily set the alignment of the tweens inside the group, like:
-
myGroup.align = TweenGroup.ALIGN_SEQUENCE; //stacks them end-to-end, one after the other
-
myGroup.align = TweenGroup.ALIGN_START; //tweens will start at the same time
-
myGroup.align = TweenGroup.ALIGN_END; //tweens will end at the same time
-
myGroup.align = TweenGroup.ALIGN_INIT; //same as ALIGN_START except that it honors any delay set in each tween.
-
myGroup.align = TweenGroup.ALIGN_NONE; //no special alignment
-
- Stagger aligned tweens by a set amount of time (in seconds). For example, if the stagger value is 0.5 and the align property is set to ALIGN_START, the second tween will start 0.5 seconds after the first one starts, then 0.5 seconds later the third one will start, etc. If the align property is ALIGN_SEQUENCE, there would be 0.5 seconds added between each tween.
- Have precise control over the progress of the group by getting/setting the "progress" property anytime. For example, to skip to half-way through the entire group of tweens, simply do this:
-
myGroup.progress = 0.5;
You can even tween the progress property with another tween to fastforward/rewind an entire group!
-
- Call any function when the TweenGroup completes using the onComplete property, and pass any number of parameters to that function using the onCompleteParams property. The AS3 version even dispatches a COMPLETE event so you can addEventListener() instead of using the onComplete callback if you prefer.
- Loop or yoyo a set amount of times or inifinitely. For example, to have your TweenGroup yoyo (reverse() when it has completed) 2 times, just do myGroup.yoyo = 2; (to loop twice instead, do myGroup.loop = 2)
- Only adds about 4Kb to your SWF (not including TweenLite and OverwriteManager which are about another 4kb combined).
At first glance, it may be difficult to see the value of using TweenGroup, but once you wrap your head around it, you'll probably find all kinds of uses for it and wonder how you lived without it. For example, what if you have a menu that flies out and unfolds using several sequenced tweens but when the user clicks elsewhere, you want the menu to fold back into place. With TweenGroup, it's as simple as calling myGroup.reverse(). Or if you have a bunch of tweens that play and then you want to loop them back to the beginning, just call myGroup.restart() or set myGroup.progress = 0. It makes some rather complex management tasks very simple.
Note: this is a brand new class, so please check back regularly for updates and let me know if you run into any bugs/problems.
PROPERTIES
- length : uint - Number of tweens in the group
- progress : Number - Overall progress of the group of tweens (not including any initial delay) as represented numerically between 0 and 1 where 0 means the group hasn't started, 0.5 means it is halfway finished, and 1 means it has completed.
- progressWithDelay : Number - Overall progress of the group of tweens (including any initial delay) as represented numerically between 0 and 1 where 0 means the group hasn't started, 0.5 means it is halfway finished, and 1 means it has completed.
- paused : Boolean - Gets/Sets the paused state of the group.
- reversed : Boolean - Gets/Sets the reversed state of the group.
- align : String - Controls the alignment of the tweens within the group. Typically it's best to use the constants TweenGroup.ALIGN_SEQUENCE, TweenGroup.ALIGN_START, TweenGroup.ALIGN_END, TweenGroup.ALIGN_INIT, or TweenGroup.ALIGN_NONE
- stagger : Number - Controls the amount of time (in seconds) to offset each tween according to the current alignment. For example, if the align property is set to ALIGN_SEQUENCE and stagger is 0.5, this adds 0.5 seconds between each tween in the sequence. If align is set to ALIGN_START, it would add 0.5 seconds to the start time of each tween (0 for the first tween, 0.5 for the second, 1 for the third, etc.)
- duration : Number - [read-only] Duration (in seconds) of the group of tweens NOT including any initial delay
- durationWithDelay : Number - [read-only] Duration (in seconds) of the group of tweens including any initial delay
- onComplete : Function - Call any function when the entire TweenGroup has completed.
- onCompleteParams : Array - Use onCompleteParams if you'd like to pass certain parameters to your onComplete function.
- loop : Number - Set this to zero to loop the TweenGroup indefinitely, or set it to an integer to have it loop a set number of times. For example, to have the TweenGroup loop twice, set loop = 2.
- yoyo : Number - Set this to zero to have the TweenGroup go forward and backwards (yoyo) indefinitely, or set it to an integer to have it yoyo a set number of times (each direction is considered one yoyo). For example, to have the TweenGroup go forward, then backward, then forward again and stop, set yoyo = 2.
- timeScale : Number - Changes the timeScale of all TweenFilterLite and TweenMax instances in the TweenGroup, allowing you to speed up or slow down the whole group. Remember, TweenLite instances are NOT affected by timeScale!.
INSTANCE METHODS
(In addition to standard Array methods like concat(), push(), shift(), unshift(), splice(), etc.)
- Description: Constructor.
- Parameters:
- tweens : Array - An Array of either TweenLite/TweenFilterLite/TweenMax instances or Objects each containing at least a "target" and "time" property, like [{target:mc, time:2, x:300},{target:mc2, time:1, alpha:0.5}]
- DefaultTweenClass : Class - Defines which tween class should be used when parsing Objects passed into the constructor that are not already TweenLite/TweenFilterLite/TweenMax instances. Choices are TweenLite, TweenFilterLite, or TweenMax.
- align : String - Controls the alignment of the tweens within the group. Options are TweenGroup.ALIGN_SEQUENCE, TweenGroup.ALIGN_START, TweenGroup.ALIGN_END, TweenGroup.ALIGN_INIT, or TweenGroup.ALIGN_NONE.
- stagger : Number - Amount of time (in seconds) to offset each tween according to the current alignment. For example, if the align property is set to ALIGN_SEQUENCE and stagger is 0.5, this adds 0.5 seconds between each tween in the sequence. If align is set to ALIGN_START, it would add 0.5 seconds to the start time of each tween (0 for the first tween, 0.5 for the second, 1 for the third, etc.)
- Description: Pauses the TweenGroup.
- Description: Resumes a paused TweenGroup.
- Description: Restarts a TweenGroup from the beginning.
- Parameters:
- includeDelay: Normally, restart() immediately starts the TweenGroup from the beginning (not including any delays), but if you'd like to include the delays in the calculations, set includeDelay to true.
- Description: Reverses the entire group of tweens so that it appears to run backwards. If the TweenGroup is partially finished when reverse() is called, the timing is automatically adjusted so that no skips/jumps occur. For example, if the entire group of tweens would take 10 seconds to complete (start to finish), and you call reverse() after 8 seconds, it will run the tweens backwards for another 8 seconds until the values are back to where they began. You may call reverse() as many times as you want and it will keep flipping the direction. So if you call reverse() twice, the group of tweens will be back to the original (forward) direction.
- Parameters:
- forcePlay: Forces the TweenGroup to resume() if it hasn't completed yet or restart() if it has.
- Description: Provides an easy way to determine which tweens (if any) are currently active. Active tweens are not paused and are in the process of tweening values.
- Description: Merges (combines) two TweenGroups. You can even control the index at which the tweens are spliced in, or if you don't define one, the tweens will be added to the end.
- Parameters:
- group: The TweenGroup to add
- startIndex: The index at which to start splicing the tweens from the new TweenGroup. For example, if tweenGroupA has 3 elements, and you want to add tweenGroupB's tweens right after the first one, you'd call tweenGroupA.mergeGroup(tweenGroupB, 1);
- Description: Analyzes all of the tweens in the group and determines the overall init, start, and end times as well as the overall duration which are necessary for accurate management. Normally a TweenGroup handles this internally, but if tweens are manipulated independently of TweenGroup or if a tween has its "loop" or "yoyo" special property set to true, it can cause these variables to become uncalibrated in which case you can use updateTimeSpan() to recalibrate.
- Description: Removes all tweens from the group and kills the tweens using TweenLite.removeTween()
- Parameters:
- killTweens: Determines whether or not all of the tweens are killed (as opposed to simply being removed from this group but continuing to remain in the rendering queue).
STATIC METHODS
- Description: Provides an easy way to tween multiple objects to the same values. It also accepts a few special properties, like "stagger" which staggers the start time of each tween. For example, you might want to have 5 MovieClips move down 100 pixels while fading out, and stagger the start times slightly by 0.2 seconds, you could do:
-
TweenGroup.allTo([mc1, mc2, mc3, mc4, mc5], 1, {y:"100", alpha:0, stagger:0.2});
IMPORTANT: If you want to use TweenMax or TweenFilterLite features in any of your tweens, make sure you define the BaseTweenClass accordingly because by default, all tweens are TweenLite instances.
-
- Parameters:
- targets : Array - An Array of objects to tween.
- duration : Number - Duration (in seconds) of the tween
- vars : Object - An object containing the end values of all the properties you'd like to have tweened (or if you're using the TweenMax.allFrom() method, these variables would define the BEGINNING values).
Special Properties:- IMPORTANT: Accepts the exact same special properties as the to() and from() methods (see list at tweenmax.com), and adds these:
- stagger: Number - delay (in seconds) between each tween's start time. This is useful for staggering the tweens.
- onCompleteAll : Function - If you'd like to call a function when ALL of the tweens have finished, use this.
- onCompleteAllParams : Array - An array of parameters to pass the onCompleteAll function
- BaseTweenClass : Class - Defines which tween class to use. Choices are TweenLite, TweenFilterLite, or TweenMax. For example, if any of your tweens use TweenMax-specific features, you'd do something like:
-
TweenGroup.allTo([mc1, mc2, mc3], 1, {y:"100", stagger:0.2}, TweenMax);
-
- Description: Exactly the same as TweenGroup.allTo(), but instead of tweening the properties from where they're at currently to whatever you define, this tweens them the opposite way - from where you define TO where ever they are. This is handy for when things are set up on the stage the way they should end up and you just want to tween them into place.
- Parameters: Same as TweenGroup.allTo(). (see above)
- Description: Parses an Array that contains either TweenLite/TweenFilterLite/TweenMax instances or Objects that are meant to define tween instances. Specifically, they must contain at LEAST "target" and "time" properties. For example: TweenGroup.parse([{target:mc1, time:2, _x:300},{target:mc2, time:1, _y:400}]);
- Parameters:
- tweens: An Array of either TweenLite/TweenFilterLite/TweenMax instances or Objects that are meant to define tween instances. For example [{target:mc1, time:2, _x:300},{target:mc2, time:1, _y:400}]
- BaseTweenClass: Defines which tween class should be used when parsing Objects that are not already TweenLite/TweenFilterLite/TweenMax instances. Choices are TweenLite, TweenFilterLite, or TweenMax.
EXAMPLES
-
import gs.*;
-
-
var tween1:TweenLite = new TweenLite(mc, 1, {x:300});
-
var tween2:TweenLite = new TweenLite(mc, 3, {y:400});
-
var tween3:TweenMax = new TweenMax(mc, 2, {blurFilter:{blurX:10, blurY:10}});
-
-
var myGroup:TweenGroup = new TweenGroup([tween1, tween2, tween3]);
-
myGroup.align = TweenGroup.ALIGN_SEQUENCE;
-
var myGroup:TweenGroup = new TweenGroup([{target:mc, time:1, x:300}, {target:mc, time:3, y:400}, {target:mc, time:2, blurFilter:{blurX:10, blurY:10}}], TweenMax, TweenGroup.ALIGN_SEQUENCE);
-
var myGroup:TweenGroup = new TweenGroup();
-
myGroup.align = TweenGroup.ALIGN_SEQUENCE;
-
myGroup.push(TweenLite.to(mc, 1, {x:300}));
-
myGroup.push(TweenLite.to(mc, 3, {y:400}));
-
myGroup.push(TweenMax.to(mc, 2, {blurFilter:{blurX:10, blurY:10}}));
-
myGroup.splice(2, 0, new TweenLite(mc, 3, {alpha:0.5}));
-
myGroup.pause();
-
myGroup.progress = 0.5;
FAQ
- When I remove a tween from a TweenGroup (using pop(), shift(), splice(), etc.), does that tween stop tweening?
No. If you want to kill the tween, you need to either use TweenLite.removeTween(myTween) or TweenLite.killTweensOf(myTarget) to stop it from playing. - What kind of tweens can I put into a TweenGroup? TweenLite? TweenFilterLite? TweenMax?
Any of the above. TweenGroup works with TweenLite, TweenFilterLite, and TweenMax instances, and any combination thereof. - Do TweenGroups automatically start playing? What if I don't want them to?
When you put tweens into a TweenGroup, it doesn't alter their paused state, so if they're active, they're remain active unless the TweeGroup is paused. Feel free to pause() your TweenGroup immediately after you create it if you'd like to prevent the tweens from playing. - Does using TweenGroup slow down my tweens at all? Do I need to be concerned about performance?
Nope, not really. TweenGroup has no effect whatsoever on the performance of your tweens. It doesn't add any load to the processor unless you call one of its methods or properties at which point it runs its code and stops, so there is no continual drain on the processor. - I'm using the AS2 version and I cannot seem to directly set or get indexes above 99 (like myGroup[200]). Why?
By default, the AS2 version of TweenGroup only allows direct access to indexes 0 through 99 because of a limitation in the AS2 language (which doesn't affect the AS3 version), but you can easily change that number by calling TweenGroup.capacity = 150 (or whatever number you want) before you create any groups. (you only need to do this once in your SWF). There is a slight memory/performance tradeoff when increasing that number, but it most likely would not be noticeable unless you use an extremely high number. - Do I have to purchase a license to use this code? Can I use it for commercial purposes?
If you use it in a commercial project, I'd strongly encourage you to at least join Club GreenSock which gets you some bonus classes (only available to club members), update notifications, and more. Your donations keep this project going. However, donations are not mandatory. Just like TweenLite, TweenFilterLite, and TweenMax, TweenGroup is free for virtually all uses including commercial projects. The only exception is inclusion in commercial products for which you sell licenses to end users. If you don't charge licensing fees for your product, you don't get charged a licensing fee for this class. If you do license your product to end users and would like to use my code, please e-mail me at info@greensock.com and we can determine a very reasonable licensing fee. Don't hesitate to inquire or assume the licensing fee would be too much - you may be surprised. Many large companies as well as single developers have obtained licenses because in their view, it ultimately saved them time and gave them a better, more reliable end product.
Need Help?
Feel free to post your question on the forums. You'll increase your chances of getting a prompt answer if you include a simplified FLA file (and any class files) that clearly demonstrates the problem and provide a brief explanation.
Copyright 2008, GreenSock, Inc.
"NO CHARGE" NON-EXCLUSIVE SOFTWARE LICENSE AGREEMENT
-----------------------------------------------------------------------------
PLAIN ENGLISH SUMMARY:
- You may use the code at no charge in web sites, games, components, applications, and other software as long as end users are not charged a fee of any kind to use your product or gain access to it. It doesn’t matter if you are paid to create the site/product. If you charge end users a fee, you must sign up for a corporate Club GreenSock membership which comes with a commercial license granting you permission to do so. See http://blog.greensock.com/club/ for details.
- Since the code is updated frequently and developers are best served by having the latest version, please avoid (or at least minimize) distributing the source code outside your organization.
- Use at your own risk. I offer no warranties.
- Please respect the copyright.
-----------------------------------------------------------------------------
LEGALESE:
This is a legal agreement between you (either an individual or a single entity) and GreenSock, Inc. ("GREENSOCK") for the proprietary GreenSock ActionScript code known as TweenLite, TweenFilterLite, TweenMax, TweenGroup, OverwriteManager, and other code that is freely available for download at http://blog.greensock.com or http://www.greensock.com (this code and documentation, as well as any updates which may at GREENSOCK's sole discretion be provided to you from time to time, are referred to in this Agreement as "PROGRAM") By installing, copying, or otherwise using the PROGRAM, you agree to the terms and conditions of this Agreement. If you do not agree to the terms and conditions of this Agreement, please do not install or use the PROGRAM.
I. LICENSE
A. Subject to the terms and conditions of this Agreement, GREENSOCK hereby grants you a non-exclusive, worldwide, non-transferable right to use the PROGRAM in web sites, games, applications, components and other software for which the end user is NOT charged any fees. If you would like to use the code in a commercially licensed software product for which end users are charged a fee (either for usage or access), simply sign up for a corporate Club GreenSock membership at http://blog.greensock.com/club/.
II. LIMITATION OF LICENSE AND RESTRICTIONS
A. You agree that you will not disclose, sell, rent, license, or otherwise distribute the PROGRAM's source code or any derivative works thereof to any third party without the prior written consent of GREENSOCK. Derivative works are defined as modifications that add substantive functionality to the PROGRAM and do not include bug fixes or other minor modifications required to operate the PROGRAM as originally intended. Limited distribution of the source code to vendors as part of your Work Product is acceptable so long as they agree to the terms of this Agreement. You agree not to modify or delete GreenSock's existing copyright notice located in the source code.
B. You may use, duplicate, and distribute the compiled object code solely as embedded in a Work Product created by you, either for your own use or for distribution to a third party so long as end users of the Work Product are not charged a fee for usage. Please see http://blog.greensock.com/licensing/ for descriptions of Work Products that qualify for the "No Charge" license.
III. CONSIDERATION
A. The license rights granted to you under this Agreement are at no charge, but only in the following circumstances: If, either on your own behalf or on behalf of a third party, you incorporate the Software into a web site, software application, program or any component thereof (collectively, “Work Product”), which in the case of a web site, must be accessible to internet users without payment of a fee of any kind by a user, and in the case of a software application, program or component, neither you nor anyone to whom you distribute the Work Product charges a user a fee of any kind to use such Work Product or application, program or component into which such Work Product is embedded. The foregoing shall apply regardless of whether you are paid to create such Work Product and, under any circumstances, shall be subject to the prohibition against distribution of Source Code set forth in Section II.
B. In the event your intended use of the Software does not meet the criteria for the “no charge” license rights set forth in the immediately preceding paragraph, then you are not licensed to use the PROGRAM under this Agreement and must license the PROGRAM under GreenSock’s separate fee-based Software License Agreement which is granted to corporate Club GreenSock members (see http://blog.greensock.com/club/ for details).
IV. TITLE AND OWNERSHIP
A. The PROGRAM is licensed, not sold, and is protected by copyright laws and international treaty provisions. You acknowledge that no title to the intellectual property in the Software is transferred to you. You further acknowledge that title and full ownership rights to the PROGRAM, including all intellectual property rights therein, will remain the exclusive property of GreenSock and you will not acquire any rights to the PROGRAM except as expressly set forth in this Agreement. You agree that any copies of the PROGRAM you make will contain the same proprietary notices which appear on and in the PROGRAM.
V. DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
A. THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. GREENSOCK DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE PROGRAM WILL MEET YOUR REQUIREMENTS OR THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE. GREENSOCK shall not be liable for special, indirect, incidental, or consequential damages with respect to any claim on account of or arising from this Agreement or use of the PROGRAM, even if GREENSOCK has been or is hereafter advised of the possibility of such damages. Because some states do not allow certain exclusions or limitations on implied warranties or of liability for consequential or incidental damages, the above exclusions may not apply to you. In no event, however, will GREENSOCK be liable to you, under any theory of recovery, in an amount in excess of the license fee paid by you under this Agreement. Notwithstanding anything else in this agreement, you agree to indemnify GREENSOCK, its assignees, and licensees, and hold each of them harmless from and against any and all claims, demands, losses, damages, liabilities, costs, and expenses, including legal fees.
B. GREENSOCK may, at its sole discretion, provide support services related to the PROGRAM, but has no obligation to do so.
VI. TERMINATION
GreenSock may terminate this Agreement at any time if you fail to comply with the terms and conditions of this Agreement.
VII. MISCELLANEOUS
A. This Agreement shall be construed in accordance with the laws of the State of Illinois. Should you for any reason bring a claim, demand, or other action against GREENSOCK, its agents or employees, arising out of this Agreement or the PROGRAM licensed herein, you agree to bring said claim only in the Illinois Court of Claims.
B. THIS AGREEMENT REPRESENTS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN GREENSOCK AND YOU AND SUPERSEDES ALL PRIOR AGREEMENTS, PROPOSALS, REPRESENTATIONS AND OTHER COMMUNICATIONS, VERBAL OR WRITTEN, BETWEEN THEM WITH RESPECT TO USE OF THE PROGRAM. THIS AGREEMENT MAY BE MODIFIED ONLY WITH THE MUTUAL WRITTEN APPROVAL OF AUTHORIZED REPRESENTATIVES OF THE PARTIES.
C. The terms and conditions of this Agreement shall prevail notwithstanding any different, conflicting, or additional terms or conditions which may appear in any purchase order or other document submitted by you. You agree that such additional or inconsistent terms are deemed rejected by GREENSOCK.
D. GREENSOCK and you agree that any xerographically or electronically reproduced copy of this Agreement shall have the same legal force and effect as any copy bearing original signatures of the parties.
| I'd like to donate & get bonus classes, update notifications, SVN access, and more. |
on October 4th, 2008 at 4:46 pm
Wow, nice stuff Jack! Another reason to argue for TweenLite/FilterLite/Max. ;-) The download links go to TweenMax downloads is that correct?
on October 4th, 2008 at 4:54 pm
Yes, LL, TweenGroup is now included with all of the tweening class downloads (TweenLite/FilterLite/Max). The link goes to TweenMax because it includes all of the other classes as well. Enjoy!
on October 5th, 2008 at 12:53 am
wow. just . . . wow. nice little Halloween treat to digg into this weekend. thank you a million times over. looking forward to playing around with TweenGroup. what a great addition to the genius that is the GreenSock family of classes. astounded as always Jack, please keep up the great work.
on October 5th, 2008 at 8:54 am
Jack,
It’s as if you read my mind, I was actually going to build a similar (though much, much less sofisticated) handler for Array’ed tweens that I created using TweenMax - now I don’t have to. I’m still completely amazed at how well your tweeners work and I can’t imagine how you manage to find the time for all this. I’m already in love with the Array aspect of TweenGroup and I haven’t even gotten around to using it yet :)
The Tween family is by far the most useful and time-saving piece of code I’ve seen/used this year. Thank you - a thousand times over.
Kind regards,
Claus
on October 5th, 2008 at 3:36 pm
Great work as always Jack,
Thanks for adding this very useful feature to the already awesome tweenLite/Max.
Looking forward to seeing more cool stuff from you.
Keep up the great work.
on October 6th, 2008 at 5:34 pm
Adobe needs to hire you!
on October 7th, 2008 at 3:16 pm
Hey there: Loving the idea.. I’m trying it out now.. I just went through a project where I needed “everything two wrap-up” if the person clicked on a continue button and this would have been perfect. Thanks so much for your hard work.
on October 9th, 2008 at 7:50 am
Hi Jack
Can you add tweenGroups to other tweenGroups, to build up really complex tweens (analogous to flex’s native Sequence and Parallel functions)
Doug
on October 11th, 2008 at 6:01 pm
Doug, yep, you sure can. Check out the new mergeGroup() method.
on October 16th, 2008 at 12:43 am
Great work!
how would you set a delay on a group?
on October 16th, 2008 at 12:51 am
Daniel, you can set a delay on a group in either of two ways:
1) If your group is aligned with ALIGN_SEQUENCE, make the first tween in the group have a delay.
2) Just pause() the group immediately, then use a TweenLite.delayedCall(TIME, myGroup.resume) to start it playing in however much time you want.
on October 17th, 2008 at 4:21 am
Hi,
I am wondering if it´s possible to start a tween in a group before the tween prior to it is complete.
In the old fuse API by Moses Gunesch there was a feature called trigger that could be specified on each tween.
on October 17th, 2008 at 9:39 am
Sure, Jonas, if you’ve got a group that’s aligned as ALIGN_SEQUENCE and you want, for example, the second tween to start 0.5 seconds before the first one finishes, you can simply use a negative delay value (-0.5 in this case) for that tween.
on November 11th, 2008 at 1:34 am
Just tried this out for the first time. Good stuff! Very well thought out. I can see this becoming regular in my tool set.
on November 18th, 2008 at 9:00 pm
Very cool…speed is impressive