[as3] Motion Guides and Motion Code

Adobe’s touting Flash CS3’s “Copy Motion as AS3” feature as a bridge between designers and developers. For the most part, I bet they’re right. And there are probably other applications for the Animator class that we can’t forsee at this time.

But I thought this feature’s greatest use would be representing complex animation elegantly in a programmatic way. Simple animation can just be coded; it’s the tough stuff that we’d prefer to animate in the Timeline, then convert to code. And Adobe seems to agree; their demonstration for this feature uses a motion tween that uses a motion guide, which is translated into Motion XML. But if you look closely at the XML, it doesn’t describe motion at all: when you copy motion along a path as AS3 code, it’ll first convert the entire tween to keyframes. That means, if you want to make the XML animation twice as long, you’ll need to properly adjust the keyframe positions for each frame that was in the animation. That doesn’t cut it for me.

On the other hand, if you just copy and paste the motion to another object, the guide will also be copied. This makes more sense; the Animator should be able to rely on a motion guide just as the Timeline seems to do.

Go ahead and give it a try. Make a little motion tween that uses a guide, copy and paste it as AS3, and look at the XML. Isn’t it impractical?