Is it time to rethink the stage timeline in Flash?
EDIT - I revised the title of this post to clarify my position in response to zool's comment below. The following is NOT an argument against timeline animations, rather, one about where they belong in the modern Flash development flow.
I generally avoid writing editorial articles on my blog, sticking strictly to informational code bits and the like. But as a developer who works closely with designers/devigners, the validity of the Flash timeline in todays development world is a topic I think worth discussing.
Since AS3 first appeared on the scene, the timeline and its ease of use for code have dramatically changed. Granted, most developers (including myself) will say that you should never, ever put code on the timeline, or even worse, after frame one, ever. However, in AS2, you could do it and all would work just fine. Nowadays, timeline code is messy at best, and the undocumented method addFrameScript() is a poor workaround at best. This is largely due to AS3 coming to Flash from Flex first, which is evident looking around the IDE and the language itself, seeing how timeline is really an afterthought in the language.
I'd like to take a second here and point out at this point that I am completely, all for using document classes and not coding in the timeline (or the IDE for that matter) at all, period. It hasn't been a best practice for a long time now and creates headaches that don't need to exist with just a little bit of knowledge about how to properly write a class. I understand the fear of stepping into classes, I've talked to designers who cringe at the thought. But the reality is that a little bit of knowledge will go a long way here.
So my question is this: why, if timeline is an afterthought in the language, is it treated as a top tier item in the IDE? Consider this - you can't create an exclusive Sprite in the IDE (a 1 frame movieclip is technically a sprite, but you can't lock the timeline to only be a sprite by definition). Maybe therein lies the solution I am (and undoubtedly others are) seeking. Really, the timeline could, and should, be a layers panel, just like in photoshop. We don't need additional frames. Why? Because frames are a property of MovieClips. The stage should be a Sprite by default. If you create a MovieClip, the timeline should be an accessible property of the clip within the IDE, with its own interface, building in the power that was added in CS4. But you should not be able to add code to those frames at all. So timelines would strictly be property of the MovieClips themselves within the IDE, just like in the language.
I think the reason we havent seen this yet is twofold: Legacy AS2 users who still use the timeline directly, and the fact that the timeline has become one of the starting points for most users, as well as an identifiable part of the IDE. I see the reasoning, but it weakens the perception of Flash by allowing loopholes for poor practices. This is furthered by the countless tutorials that start with the timeline as step one of using Flash. Take a glance at the newgrounds forums for Flash and you'll see the problem post by post. The language and the IDE need to coexist better as complements to each other, without stepping on each other's toes as much as they do right now.
I think for AS3 projects it's time to lose the timeline rather than force fit it into a language that doesn't really properly support it. There's no reason to. Timeline animations are great, but that's just what they should be - animations. An asset to be referenced and used by code, within AS3 at least. Legacy users are always a consideration, but that doesnt mean you can't force the users of newer technologies to use newer, improved standards. AS3 shouldn't have to support improper code techniques - that's what the support for AS2 in the IDE is for. The addFrameScript() method shouldn't even need to exist in the first place. If Adobe forces everyones hands to fully seperate AS3 code in .as files and animations in the timeline, where they belong, we'll all be better off, and that would be one less knock against Flash as a hack language.
So what do you think? Weigh in in the comments.




September 17th, 2009 - 10:29
Right on, brother!
September 23rd, 2009 - 17:16
disagree…. ripping through massive amounts of assets is the arena of timeline tweening. look at after effects. should after effects do away with the timeline as well ? keyframing and tweening is an elegant solution for cranking out content. just because we are OO developers does not mean we should require everyone to know how to code, in order to create flash content. in fact CS4 totally ruined many time honored speed keyframing methods, we don’t use it around here. weak sauce keyframing ruins any improvements in tweening CS4 has….
And, yes, I’ve been compiling outside the Flash IDE since 2000, I run FDT/ANT/MXMLC/MTASC. I still love keyframing when it gets the job done.
September 23rd, 2009 - 17:31
@zool: I think you missed my point – I definitely agree that keyframe animations serve a purpose, there are definitely countless instances where the timeline is much better suited to the task than code. This is not about code negating the need for timeline animations, it’s about the fact that timeline animations should be treated assets, i.e., movieclips with a timeline within. It’s more the stage timeline that I’m pointing out as a bad idea, as well as the usage of code within the timeline itself, both of which can live confortably alongside your argument, which is definitely, completely valid.
February 3rd, 2010 - 10:19
Great article, I think is time for Adobe to get it together and come up with their own device or be more compatible at this point.