The Flash Anthology: Cool Effects & Practical ActionScript

Sometimes you want a Website to look, well, a little more animated. When that happens it's time to turn to Flash. In The Flash Anthology: Cool Effects & Practical ActionScript by Steve Grosvenor you'll see how to build over 60 real-world Flash applications that can add wow factor to your Web site.

This book is aimed at developers who've got the basics of Flash under their belt but haven't yet delved too far into ActionScript. By providing solutions to some of the most common Flash problems, and addressing frequently desired tasks this book aims to inspire, educate and motivate.

DMXzone will be reviewing the book shortly (see here) but before then, courtesy of the publishers Sitepoint, we've got a sample chapter from the book covering Animation Effects available for download (and a short snippet extracted below).

 Order The Flash Anthology: Cool Effects & Practical ActionScript, direct from Sitepoint >>

The Flash Anthology: Cool Effects & Practical ActionScript - Chapter 3: Animation Effects

The fads of Internet design may come and go, but one thing that will never change is that the more dynamic you make your Flash creations, the more engaging they are to the user. This dynamism can be counterproductive under certain circumstances, especially when multiple effects battle for the user's attention, or the effects are too garish. Identifying the key to effective animation is like the search for the Holy Grail. What some users think is a cool effect, others find patently uninteresting—and vice versa. Never lose sight of the importance of striking a balance between the interface and the animations you're attempting to produce.

Flash has always had as its nucleus animation and motion. This is, after all, what Flash was originally created for—the animation of objects over time. As new versions are released and the technology evolves, so do the capabilities of Flash's scripting language. What we could once achieve only with keyframes and tweening can now be accomplished in a few lines of ActionScript. Some developers find this reality difficult to grasp, but as we saw in Chapter 2, Navigation Systems, once you understand the basics, you can build on them with new experiments.

With very few exceptions, what can be done with keyframe tweening can also be achieved through ActionScript. But, what are the advantages of scripting? The answer's simple: portability, scalability, and manageability. You can affect an animation dramatically by tweaking an equation or a few variables in its ActionScript. This process is much easier than laboriously editing motion tweens, which can sometimes appear in their hundreds in large animated effects.

This doesn't mean that motion tweening is dead, however—not by a long shot. If you create simple motion tweens (for example, an effect that shows an object increasing in size), then script the effect multiple times and experiment with it via ActionScript, you can create some pretty amazing effects with a minimum of effort.

With Flash MX 2004, and the introduction of Timeline Effects, creating these motion tween building blocks takes even less work than it did before, as we'll see in the coming chapter. I'll give you the information you need to develop both classic effects you can be proud of and exciting new animations. You'll also learn the techniques involved in creating innovative Timeline Effects. It's virtually all ActionScript from here on, so have your calculator and pencil ready! And if you need a little review of the essentials of Flash, don't miss Chapter 1 of this series [1].

Note also that you can download this chapter in pdf format [2] if you'd prefer to read the content offline.

Animation Principles

If you are reading this book, then I can be pretty sure you have a copy of Flash MX or later. You probably purchased Flash because of the animation capabilities that lie at its heart. In the most basic form of Flash animation, we can smoothly transition an object's location or shape from point/shape A to point/shape B by altering the properties of that object at keyframes within the timeline. This used to be a cumbersome process in previous versions of Flash, but it's more accessible now. With a solid understanding of ActionScript and the dynamics of motion you can rapidly create animation effects that would have taken many hours to create with previous versions.

Hit the books!

What did you do with your old Physics and Math textbooks when you left school? Did you throw them away? Shame on you if you did—they can be an invaluable source of inspiration for creating mathematical and motion-related scripted animations in Flash. I'm a bit of a hoarder, which probably explains why I've still got mine!

There are many uses for Flash in creating animation. Perhaps you want to create a straightforward animation that moves an object from point A to point B. Maybe you're itching to build a more complex animation with a "real world" feel, easing objects into position or having them exhibit elastic characteristics. Both simple and advanced animations are possible in Flash via different methods: by hand, using complex keyframes and motion tweening, or with the help of ActionScript.

While the ActionScript method of animation may initially appear difficult, once you become comfortable with its methodologies for movement and learn the nuances of its quick, effective methods, you'll soon be creating increasingly complex animations and building on your existing knowledge. If this is your first experience with ActionScript, you'll soon be surprised how easy it is to create scripted animation. This should inspire you to explore your own ideas and experiments, and take ActionScript to the limit.

Ian Blackham

Ian BlackhamFollowing a degree in Chemistry and a doctorate in Scanning Tunneling Microscopy, Ian spent several years wrestling with acronyms in industrial R&D (SEM with a side order of EDS, AFM and TEM augmented with a topping of XPS and SIMS and yet more SEM and TEM).

Feeling that he needed a career with more terminology but less high voltages, Ian became a technical/commissioning editor with Wrox Press working on books as diverse as Beg VB Application Development and Professional Java Security. After Wrox's dissolution and a few short term assignments Ian became content manager at DMXzone.

Ian is a refugee from the industrial Black Country having slipped across the border to live in Birmingham. In his spare time he helps out with the website of a local history society, tries to makes sure he does what his wife Kate says, and worries that the little 'un Noah is already more grown up than he is.

See All Postings From Ian Blackham >>