THE PASZ.COM BLOG

Monday, August 01, 2005

Flash 8 Demo - Rainbow

I've done my first full-fledged Flash 8 demo. Remember the NBC peacock?

So I created that kind of rainbow effect by rotating a line segment using a matrix transformation. Now granted, you could create the same kind of effect using plain old MovieClips and rotations, but this seemed like a good way to play around with new functionality.

rainbow demo
big circle rainbow demo

I'll post the code later this week, so be sure to check back on my blog.

The Flash 8 Beta Player is required to view these demos!

One note about how slow the frame rate is - at first I though this was because Matrix operations are pretty processor-intensive. As mentioned by Patrick Mineault:
flash.geom.* is implemented in player actionscript, not ASNative. All I can say is wtf? It sounds like flash.geom.* is going to be used with bitmaps transforms and such, it better damn be implemented in C++ by the time the player is out of beta, as it has potential to be a bottleneck
After further experimentation, though, I've concluded that the main bottleneck here is that I'm pushing the limits of the drawing API. To draw a large circle, I have to construct up to 360 line segments per frame. As the number of segments increases, things bog down. I was wondering if MovieClip.cacheAsBitmap might help here, but apparently not...

5 Comments:

Post a Comment

<< Home