Anybody who has ever had a performance problem with a graphically-rich Flash app has seen the “Show Redraw Regions” option in the debug player. Well, at least I hope they have since it’s right there in the context menu and there’s even a function call to toggle them. Normally it’s pretty straightforward what gets redrawn and when, but when you start to mix in advanced features like scrollRect and cacheAsBitmap, things get complicated. Today I’m going to cover a technique for eliminating some mysterious redraw regions.
Posts Tagged bitmaps
The BitmapData class is among the most useful classes in AS3. When it was introduced in Flash 8 it dramatically improved Flash development by opening up new potential for features and optimization. Since it’s used so often, it’s good to know as much about it as possible. Today I’m going to cover the performance difference that turning alpha (a.k.a. transparency) on makes.
I recently received an e-mail from Dmitry Zhelnin (translation) with a test he did concerning the speed of a couple ways to get a value for a key, which I like to call a map and Wikipedia likes to call an associative array. I’d been meaning to do a similar test for a while now and, guess what, I finally have! UPDATE: fixed miss test for fixed-size Vectors.
AS3 gives you a good number of potential ways you can loop over collections. When Flash Player 10 first came out, I went ahead and tested out the new Vector class in a variety of ways. One of them was to pit it against the collections available in Flash Player 9: Array, Object, Dictionary, ByteArray, and even BitmapData. Below I’ll show you my test and discuss its results.