Archive for September, 2012

Loop Speed Redux

Tags: , , , , , , , , , ,

AS3 has three kinds of loops—for, for-in, and for-each—but which is fastest? I attempted to answer that question about three years ago, but the article is in dire need of a followup as many version of Flash Player have been released since then and the question is core to our everyday lives as AS3 programmers. So which type of loop is fastest in 2012?

Read the rest of this article »


Using New Flash Player Features

Tags: , , , , ,

Adobe adds new features to every new version of Flash Player. To use these features, you have to compile your SWF correctly. Unfortunately, setting up your build environment and passing the right options to the compiler can be a bit tricky. Today’s article attempts to clear up the confusion so you can take advantage of the latest Flash Player features.

Read the rest of this article »


Maps With Int Keys: Array vs. Dictionary

Tags: , , , , , , , ,

Behind the scenes Array holds its values in two ways: a densely-packed array at the beginning and a sparsely-packed map after that. This means it can be used as a map where the keys are indexes and not take up a huge amount of wasted space. Dictionary can also have int keys. Which is faster? Today we’ll find out!

Read the rest of this article »


Converting Numbers to Ints

Tags: , , , , , , ,

This is an extremely common task: converting a Number to an int. There are a lot of ways to do it, but which is fastest in AS3? Today we’ll look at a performance test app that attempts to find the fastest way to accomplish this. The answer just may surprise you!

Read the rest of this article »