Special notice! While MC Tween is a nice extension and it will continue to work for AS1 and AS2 until the end of time, it is my duty to inform all citizens that I have switched the focus from further development on MC Tween to a new AS2 and AS3 extension, a real Class this time, called "caurina.transitions.Tweener" (or just Tweener). Tweener doesn't have as many features as MC Tween yet (for example, it doesn't have native filter tweens), and the documentation isn't 100% done, but it features a complete, more solid redesign with a few additional syntax features that were impossible to achieve with MC Tween. And it works the same for AS2 (including Flash Lite 2+) and AS3.
So, if you use MC Tween, or you're thinking about using it, I'd like to suggest you try Tweener instead. It follows all the principles of simplicity I tried to feature on MC Tween, but with a more powerful syntax. Tweener download, examples and documentation are available on Tweener's page. You can read more about this change on this blog post.
Thank you for your attention and sorry for this ugly box. And don't worry, this website will not be deleted or anything.
Notice for October 2008: also note that, if you are still interested in MC Tween and don't want to use class-based AS2 or AS3 solutions, Larry Benedict has taken the matter into his hands and updated MC Tween with some filter features that are not available in the latest version. You can read more about it (and download his version) here or here.
Just what the hell is MC Tween?
MC Tween is a free library of prototypes that can be used on Flash MX and above (with both AS1 and AS2) to create property tweenings dinamically using several different easing equations - in practical words, creating easing animations via simple and small coding. Also called a tweening extension, MC Tween is just a bunch of actionscript code you can add to your Flash movies via a #include command. You will then have several "new" MovieClip, TextField and Sound methods and functions at your hand.
For example, suppose you want to move a movieclip across your screen, up to x (column) position 100. You would usually do this:
myMovieclip._x = 100;
However, that's just a crude, instant move. You could also create some functionality based on some onEnterFrame code but that could quickly turn your code into a mess. That's where MC Tween comes into play. Let's suppose you want to move something using an animation, to provide a smoother experience for the user. Using MC Tween, you could do:
This would move myMovieclip to x position 100, doing an animation - a tweening - instead of just moving the object to the new position instantly. Of course, we can use several parameters on the tween function - including saying how much time we want it to take to get there, which animation type to use, and many more.
This is just an introduction to what a tweening extension is all about. While the tween method is the core of this extension, there are many more methods (including shortcuts) that can be used on different object types - MovieClip, TextField and Sound objects. Refer to the documentation for more information on which new commands are available, or run the examples to see it in action.
Also, keep in mind that while several great tweening extensions already exist, I created this one with the designers in mind - my goal was to allow people to tween a MovieClip property through one swift and simple command instead of wasting 3-4 lines of code just to create a new tween/timeline object, set its animations, and start it.
Key features of MC Tween
It's simple. You see, there are several others tweening extensions available. Some of them are really powerful. However, when creating this one, I wanted to make it simple to use - so most Flash designers could use it - while still keeping it powerful. That's why MC Tween simply adds new methods and functions to the MovieClip, TextField and Sound classes, instead of creating a new class with its own methods and functions. That means that you just need to #include "mc_tween2.as" and use one simple command to create a new tweening - you don't have to create a new tween object, add tweenings, start them, etc. While there are real reasons to make it OOP-orthodox by using classes, I wanted to make it simple, easy, fast, powerful, and readable.
It doesn't use the MovieClip's own onEnterFrame event. That was a problem on the first tweening prototypes, as they used the original object's onEnterFrame, meaning you couldn't use it anymore yourself. MC Tween does a clean job of keeping its own business elsewhere, as to not mess with the tweened objects themselves.
It is based on time, not on frames. This is actually one of the best features of time-based tweening engines. With this, you can create transitions completelly based on time, and not on the computer speed. If you tell a MovieClip to alphaTo() in 1 second, for example, it will take 1 second to do the fade, no matter what's the speed of the computer or the movie. This is most welcomed when creating movies that will run with similar timings on all kinds of CPUs and OSs available - so Mac users won't have to wait for 10 seconds just for a text to fade out, for example. While the playback quality will still suffer on slow machines - the framerate will always be lower than ideal - MC Tween ensures that the user doesn't have to wait more because of that. All users will have the same transition times.
It's reusable and can be used at different times. You can tween different properties from on the same object, at different times - none will get overwritten. You can also issue different several tweens on the same property on a sequential way - ultimately, creating complex new animations, one transition per line of code.
You can tween as many properties as you want on a single line. It can use arrays as parameters, so you can do complex tweenings with one simple line of code.
It has shortcut methods to make coding easy and the source more readable. You don't need separate fade, slide, transform, and color protoypes - this one does it all that with a similar syntax. You could only use the tween() method directly for all kinds of tweenings possible, but in case you're doing some standard tweenings, you can use slideTo(), alphaTo() or colorTo(), just to cite a few examples.
You can also use it on TextFields and on Sound objects. This is not a MovieClip-only tweening extension, as it adds new methods for manipulating other types of objects.
It saves the world (TM).
Other important topics available here
» Documentation - A comprehensive list of all methods and functions available when using MC Tween, with explanations and examples.
» Animation Types - A list of all animation types (or easing equations) available when tweening values with MC Tween. Includes graphics for better understanding.
» Downloads - Where to download MC Tween's installation files and other goodies.
» Examples - Several raw but didatic examples of MC Tween in use. Source code included.
» Extensions - Extensions that add new specific features to MC Tween.
» Author and disclaimer - More about me, and some needed acknowledgements and disclaimer.
» Links - Links to some tween-related Flash resources, including some other tweening extensions.