Posts Tagged loops

For Vs. While

I’ve recently been seeing more and more usage of while loops by those who I presume are interested in performance. I’ve always assumed that these was not faster than for loops, but today I am finding out.

Read the rest of this entry »

Tags: , , ,

4 Comments

Loop Speed

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.

Read the rest of this entry »

Tags: , , , , , ,

5 Comments

Changing Arrays Midstream

I often wonder about language features that I know have a lot going on behind the scenes. In AS3, this commonly has me wondering about the for-in and for-each loops, which I use frequently. This article is about what happens to those loops when you change the array you’re iterating over during the iteration.

Read the rest of this entry »

Tags: ,

2 Comments

Flexible Loop Syntax

First things first: this might be a bug in MXMLC. It sure did cause a bug in my program though! Read on for the stupid mistake that had me scratching my head.

Read the rest of this entry »

Tags:

4 Comments

Loop Safety

This is a curiosity I’ve had for far too long. Why didn’t I make these simple tests years ago when I was first learning AS3? I’m not sure, but judging by a lot of other people’s AS3 that I’ve read, many people don’t seem to understand it.

Read the rest of this entry »

Tags:

4 Comments

Messing With Iterators

The for-in and for-each loops are convenient and likely to be the loops you use most. For this reason alone you should make sure you know what you can and can’t do with them. Here’s one thing I just found can save me some typing and some bloat.

Read the rest of this entry »

Tags:

2 Comments

ActionScript 3 Loops

The for-each and for-in loops in JavaScript and AS3 are very convenient ways to avoid the repetition of C-style for loops. Let’s take a look at them all, what they’re good for and bad for, and see if we can find any gotchas.

Read the rest of this entry »

Tags:

3 Comments