all groups > flash actionscript > january 2007 >
You're in the

flash actionscript

group:

Advice on animating lots of small movie clips


Advice on animating lots of small movie clips Wil
1/2/2007 10:19:30 PM
flash actionscript:
Hi,

I have a performance problem that may be best demonstrated with an example.

http://www.b3ta.cr3ation.co.uk/data/swf/game1.swf

If you look at the animation and watch it for a while you will see the
number of balls growing.
Initially the performance is so-so but eventually it becomes totally
unacceptable. So I was wondering if anyone could impart advice about any
optimizations.
Every tile is a movie clip and every ball is a movie clip that tweens from
one tile to the next. I also need to read the frame the clips are on but
when I bound a class to the balls clip it immediatly ran unacceptably slow.

I have a plan B which involves creating tile animations of each of the ball
animations, which I know would create a huge performance gain but would mean
creating 510 tile animations and thus make the animations unmaintainable.

TIA
Wil

Re: Advice on animating lots of small movie clips sly one
1/3/2007 1:40:12 AM
How are you doing the tweens? OnEnterFrames? You will want to delete each of
the onEnterFrames as they each finish.

Other than that you are running into a major Flash wall: you can't have
hundreds of animations running at the same time. Flash just isn't built for
that.
Re: Advice on animating lots of small movie clips kglad
1/3/2007 1:52:53 AM
i suspect that's poor coding. there just aren't that many movieclips present
when you start having significant performance issues.

in addition to efficient coding you can also enable the cacheAsBitmap property
of your movieclips, if you're using flash 8.
Re: Advice on animating lots of small movie clips Wil
1/3/2007 3:12:14 AM
Oi! OK it may be a fair point though the code should be simple enough not to
cause problems. I'll have a review.

Cheers.

[quoted text, click to view]

Re: Advice on animating lots of small movie clips Wil
1/3/2007 3:14:40 AM
I created a new tween object just the once for each x and y as neeed. Would
that make much odds?

Is the other poster kglad correct in saying the number of visible movie
clips in this instance shouldn't be causing problems?

Cheers
Wil

[quoted text, click to view]

Re: Advice on animating lots of small movie clips kglad
1/3/2007 8:08:47 AM
i think he is correct. you're swf starts to hiccup with less than 10 of those dots on stage.

Re: Advice on animating lots of small movie clips Wil
1/3/2007 9:49:09 AM

[quoted text, click to view]

Ok cheers

AddThis Social Bookmark Button