LoaderMax is a new AS3 loading system that does much more than just getting swf, mp3, css, video, image, text, binary, and xml files into your Flash application. It eats files for dinner, burps, and then asks for 2nds. And 3rds. Yet it’s surprisingly thin. In fact, it can be half the size of most other loading systems even though it delivers a bunch of unique capabilities, some of which you probably never knew you needed but won’t want to live without. Here are a few of the noteworthy features…
AutoFitArea – Stretch/Scale/Position DisplayObjects to Fit Within a Rectangular Area
AutoFitArea allows you to define a rectangular area and then attach() DisplayObjects so that they automatically fit into the area, repositioning and scaling/stretching in any of the following modes: STRETCH, PROPORTIONAL_INSIDE, PROPORTIONAL_OUTSIDE, PROPORTIONAL_CROPPED, NONE, WIDTH_ONLY, or HEIGHT_ONLY. Horizontally align the attached DisplayObjects left, center, or right. Vertically align them top, center, or bottom. Even apply a minimum/maximum width/height for each attached object. AutoFitArea extends the Shape class, so you can alter (and yes, tween) the width/height/scaleX/scaleY/x/y properties of the AutoFitArea and then all of the attached objects will automatically be affected. Attach as many DisplayObjects as you want.
TweenNano – 1.6k TweenLite with Some Sacrifices
TweenNano is a super-lightweight (1.6k in AS3 and 2k in AS2) version of TweenLite and is only recommended for situations where you absolutely cannot afford the extra 3.1k (4.7k total) that the normal TweenLite engine would cost and your project doesn’t require any plugins. Normally, it is much better to use TweenLite because of the additional flexibility it provides via plugins and its compatibility with TimelineLite and TimelineMax.
TimelineMax – Sequence/Group Multiple Tweens, Control Them as a Whole
TimelineMax extends TimelineLite, offering exactly the same functionality plus useful (but non-essential) features like AS3 event dispatching, repeat, repeatDelay, yoyo, currentLabel, addCallback(), removeCallback(), tweenTo(), tweenFromTo(), getLabelAfter(), getLabelBefore(), and getActive() (and probably more in the future). It is the ultimate sequencing tool. Think of a TimelineMax instance like a virtual MovieClip timeline or a container where you position tweens (or other timelines) over the course of time.
TimelineLite – Sequence/Group Multiple Tweens, Control Them as a Whole
TimelineLite is a lightweight, intuitive timeline class for building and managing sequences of TweenLite, TweenMax, TimelineLite, and/or TimelineMax instances. You can think of a TimelineLite instance like a virtual MovieClip timeline or a container where you place tweens (or other timelines) over the course of time.
Last Call for v11 Input
Before officially releasing v11 of the GreenSock tweening platform, I wanted to solicit feedback from the community one last time, particularly on TimelineLite/Max because after the API is locked down, it’s pretty tough to change. Here are the specific questions I’d like feedback on (please feel free to offer feedback/suggestions about topics that aren’t on this list too):
- 1) TimelineLite & TimelineMax – how does the API “feel”? – Does it give you the power and flexibility you need without being bloated? Have you found yourself needing some kind of functionality that’s missing? Is everything intuitive?
- 2) Should ALL plugins be activated in TweenMax by default? – I haven’t done so because I’m afraid it may be seen as “bloated” with the extra kb. On the other hand, it’s not terribly difficult to open the class file and prevent activation of certain plugins if you need to conserve file size, and activating all plugins would prevent some potential confusion for newbies. Keep in mind that there will likely be more and more plugins over time that offer added functionality, so if they’re all activated, TweenMax may hit 30kb at some point in the distant future.
- 3) Should I eliminate the default plugin activations in TweenLite? – This would cut the default file size by around 40%. When I asked this question in v10, I got a fair amount of feedback saying backwards compatibility was much more important than small file size, especially because end users could delete the activation code inside the class file if they needed smaller file size. Then again, TweenLite is supposed to prioritize small file size and a lot of end users are either scared to or don’t understand how to delete the activation code in the class file.
- 4) Are there any important features missing? – I’m trying to prevent bloat while at the same time provide tremendous flexibility, power, and speed. It’s a balancing act. Let me know if you were really hoping a particular feature would make its way into one of the classes.
- 5) What is your favorite feature (or features) that absolutely, positively shouldn’t get cut? – I’m not fishing for compliments here – it’s just helpful to know what the community values so that those features don’t end up on the cutting room floor (so to speak).
- 6) Should “repeat” be renamed “cycles”? – “repeat” seems more common, but some have suggested that “cycles” is more intuitive. If it gets changed to “cycles”, what would you name “repeatDelay”?
- 7) Should append() and prepend() be eliminated from the timeline classes? – One developer suggested eliminating append() and prepend() because they’re not absolutely necessary. For example, append() could be accomplished with myTimeline.insert(myTween, myTimeline.duration). prepend() is more difficult, though. Personally, I find them very intuitive for building sequences and they don’t cost much kb.
If you haven’t tried v11 yet, especially the TimelineLite and TimelineMax classes, I’d highly recommend it.
GreenSock Tweening Platform v11 Beta (Introducing TimelineLite/Max)
On the heels of releasing the huge v10 update that introduced the plugin architecture, I’ve been hard at work on an even bigger release that delivers quite a few exiting improvements to the GreenSock Tweening Platform. Version 11 represents some significant changes to the guts of the code, so before officially releasing it, I wanted to post it in “Beta” form to give everyone a chance to not only test the code but also share their thoughts and suggestions. I’m also thrilled to announce that Grant Skinner (author of gTween) will be collaborating with me on v11 (see separate announcement).
By far the biggest news in terms of functionality is the addition of the “TimelineLite” and “TimelineMax” classes. They make building and managing sequences/groups of tweens simple. They originated from TweenGroup, blossoming into something much more powerful, flexible, and intuitive. Think of the timeline classes much like MovieClip timelines in the Flash IDE where you position individual tweens over the course of time.
Announcing TweenLite/Max Version 10
This update of TweenLite and TweenMax is probably the most significant ever, so I figured the announcement warranted a page of its own to describe all the exciting enhancements and to answer common questions.Full documentation still resides on the regular TweenLite and TweenMax pages. Version 10 delivers a whole new level of flexibility, performance, and tweenable goodness…
LiquidStage – Automatically Reposition/Stretch DisplayObjects in Full-Browser SWFs
LiquidStage allows you to “pin” DisplayObjects to reference points on the stage (or inside other DisplayObjects) so that when the stage is resized, they are repositioned and maintain their relative distance from the PinPoint. For example, you could make a logo Sprite stay in the bottom right corner when the stage is resized.
You can also scale or stretch DisplayObjects using the LiquidArea class which allows you to define a rectangular area that expands and contracts as the stage resizes, and you attach DisplayObjects so that they fill the area, scaling in any of the following modes: STRETCH, PROPORTIONAL_INSIDE, PROPORTIONAL_OUTSIDE, WIDTH_ONLY, or HEIGHT_ONLY. For example, you could have a bar snap to the bottom of the screen and stretch horizontally to fill the width of the stage. Or add a background image that proportionally scales to fill the entire stage.
TweenGroup – Manage Sequences and Groups of TweenLite/Max Tweens
With the launch of v11, TweenGroup has been offially deprecated in favor of the much more capable, flexible TimelineLite and TimelineMax classes. They do almost exactly what TweenGroup did but in a much more intuitive, flexible, powerful way. You can even nest timelines within timelines. I realize TweenGroup’s deprecation may sound like bad news to some developers, but trust me, once you use TimelineLite/Max I’m confident you’ll see why this is a good move. I try very hard to avoid deprecating things because people grow to rely on the code, so rest assured that I didn’t make this decision lightly.







