Posts Tagged arrays

Making Vectors Out Of Mixed-Type Arrays

The chief quality of Vectors is that they hold a single type of object. This is why they are sometimes called “typed arrays”. So what would happen if you wanted to convert an array of mixed-type objects into a vector?

Read the rest of this entry »

Tags: , ,

No Comments

Dynamic Access: Part 1 (Indexing Arrays and Vectors)

Many classes in AS3 are dynamic, meaning that you can add and remove their fields at runtime. This is powerful, but extraordinarily slow. This series will cover some common ways you might be inadvertently using dynamic access or using it too much. This will help you make your code faster. In the first installation of the series, I’m going to talk about the simple act of indexing an array or vector.

Read the rest of this entry »

Tags: , , ,

1 Comment

Comparing Objects

The comparison operators (< , <=, ==, >=, >) are clearly core to any programming language. The AS3 docs tell us a little about AS3′s special handling of strings when compared, but there is more to the story.

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

Converting Vectors to Arrays

Vectors– typed arrays in AS3– are much quicker than arrays and therefore very useful. There are many times where you end up with arrays though and need to convert them into vectors for the bulk of your using that data. This article is about that process.

Read the rest of this entry »

Tags: , ,

1 Comment

Clearing an Array or Vector

There are many ways to clear an Array or Vector. I’m tired of seeing the foolish ones. Read this and make sure you’re not doing anything foolish:

Read the rest of this entry »

Tags: ,

5 Comments

Missing Array Elements

As a sane programmer, you probably wouldn’t ever think to do this. But It’s perfectly legal to do so.

Read the rest of this entry »

Tags:

No Comments