Be the first to write a review
Free - Dynamic Animation with Fuse Kit
At some point, most Flash developers get a project where you have to do motion animation in code instead of tweens in the timeline. Video games, simulations or custom UI components are obvious places where code based animation may become necessary. But animating with code can require a lot of lines of code.
The Tween class
When Macromedia made the v2 UI Components in Flash MX 2004, they included a class used in the component infrastructure called "Tween". The Tween class allows you to change a property (such as _x, _y, _rotation, _alpha, etc.) of a MovieClip over time, with various built in easing effects.
There are a few problems with using the Tween class. The first is that a single instance of a Tween class can only animate one property of a MovieClip. So, if you want to adjust _x, _y, _rotation and _alpha, you need four Tween instances (one for each property). The second draw back of Tween, is that there are a large number of parameters needed to create an instance, so it's a long line of code. This compounds the first problem of needing to create multiple Tween instances, but making each instance a painfully long line of code.
The last major drawback with Tween is that if you don't manage it well and clear out completed or unnecessary Tweens, you can end up in a situation where Tweens just keep on animating uncontrollably, similar to having a setInterval call run off on you when you don't clear the interval religiously.
Fuse Kit
An open-source alternative to the Tween class called Fuse Kit, written by Moses Gunesch, combines a number of previous people's work into a single and very powerful ActionScript Animation kit. It's a kit because you can choose which assets you want to use and only those assets will be compiled into the SWF. So if you are only going to use limited assets in the Fuse Kit, you can choose to create very light SWFs. But if you are going to use some of the higher-end features, you'll end up with a larger SWF file, but you'll have some great code based animations.
We'll take a look at each of the classes that make up Fuse Kit and how you can use them to create some very robust code driven animation.
Conclusion
This article was intended to just wet your apatite for more about Fuse Kit. There are so many more things, including throwing events (by calling functions) when specific animations complete, looping animations, customized easing (see Fuse Kit docs about PennerEasing!!), etc. that I just didn't have room to discuss in this format.
Check out the examples that come with the Fuse Kit package to see how to use it. Hopefully with this introduction, you'll be interested in looking deeper into it. I'd also strongly recommend Lee Brimelow's video demonstrations at his site (http://www.gotoandlearn.com). Lee has some great coverage of Fuse Kit in a very approachable way.
Most importantly, continue to play and experiment with Flash and Fuse Kit. It's really a lot of fun. Once you have a handle on how to use it, the possibilities are endless.
Satori Canton
Satori has been an Internet and marketing consultant since 1994. He started by educating companies in ways they could use the emerging Internet for marketing, communications and customer service. He now serves as the President and CEO of ActionScript, Inc.
In the mid 90's, he worked creating game levels and expansion packs for games like Duke Nukem, Quake, WarCraft, Diablo, Microsoft Flight Simulator, Redneck Rampage, and X-Wing vs. Tie Fighter. In 1996 Satori created Satori Interactive to serve as the online wing of his game development and market consulting business.
In 2005, Satori Interactive acquired ActionScript.com and continues to develop applications, multimedia presentations and games for major corporations, specializing in online market consulting, gaming, "advergaming" and Flash/Flex application development.