Okay, how about the simple scenario where you want the playback of a series
of frames of animation... you know, exactly what a movie clip does? I could
definitely do this by creating a class that extends sprite and in that class
keeping an array of shapes (or sprites) and each ENTER_FRAME event moving my
virtual playhead forward to the next sprite, etc., etc...

And you know what I'd get? A MovieClip! Looks like Adobe already wrote that
one! ;-)

Seriously, though, the problem is not that you can't programmatically edit a
MovieClip, it's that Adobe's docs don't make it clear why you wouldn't want
to do that... because the MovieClip is a much more complicated beast that
stores tween details, etc., that aren't exposed in the API (details you'd be
familiar with if you've ever attempt to generate SWF's from scratch in an
open-source tool like I did back in the Flash 4 days).

The docs describe MovieClips as basically sprites with timelines... which
would lead one to think, "hey, sprite is great, but I need a timeline 'cause
I got some animation, so I must need a MovieClip!" I know this because I
went down the same route.

What I ended up doing was basically creating an AnimatedSprite class... it
has a currentFrame property, and list of frames (which, in my case, are
BitmapData's). Each frame it increments currentFrame and updates its display
list to include the appropriate bitmapData. Pretty simple stuff...

So, to address the original poster: MovieClip is just a mirage! Think of it
like its got a scarier name like "CompiledSWF" and treat it like a blackbox.
It'll make your life easier.

Troy.


On 3/29/07, Merrill, Jason <[EMAIL PROTECTED]> wrote:

   Matt,

So Paul and I discussed our pointless bickering offlist and hugged it
out.  We're good now.  Both of us however were just wondering about this
question you have (me, so I could you, him for academic reasons) since we
ironically agreed offlist neither of us could figure a good use case for
needing do do this.  Maybe you can explain in more detail what you will do
with these frames once they are inserted.  But really, we probably should
move this to a Flashcoding list like Flashcoders.

Jason Merrill
Bank of America
GT&O Learning & Leadership Development
eTools & Multimedia Team

Reply via email to