Archive for category AS3

Changing Arrays Midstream

Tags: ,

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 article »

4 Comments

Indexing Anything

Tags: ,

Indexing is a little bit special in ECMAScript languages like AS3, AS2, and JavaScript. MXMLC will gleefully let you index just about anything, even if there isn’t a chance it’ll work.

Read the rest of this article »

1 Comment

Pointless Code

Tags: , ,

We’ve all seen it, perhaps even in our own code. It’s something I think we do because we’re not really sure what would happen if we didn’t do it. Here are some little tidbits of pointless code I’ve been seeing recently:

Read the rest of this article »

7 Comments

Nested Functions and Function Variables

Tags: ,

Turns out that AS3 supports ! I have been making Function variables for a long time. Read on for the greatness that is nested functions.

Read the rest of this article »

No Comments

Flexible Loop Syntax

Tags:

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 article »

4 Comments

Dictionary Conversion

Tags:

Dictionaries are very useful. Unlike Objects, your keys don’t need to be Strings. But there are remnants of this String requirement that are not obvious. Fortunately, it’s a simple rule to remember…

Read the rest of this article »

No Comments

Converting Vectors to Arrays

Tags: , ,

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 article »

3 Comments

Variable Clashes

Tags: , ,

Scoping is pretty weird in AS3 for those coming from C/C++ and Java. There are two cases in particular you should know about.

Read the rest of this article »

3 Comments

Fun With Dynamic Functions

Tags:

Dynamic functions are a very useful feature of AS3 and JavaScript. Closures constantly come in handy for cleaner, more powerful code. Here’s a feature you might not know about them though.

Read the rest of this article »

No Comments

Abstract Classes

Tags: ,

Abstract classes are an explicit language feature of Java via the abstract keyword. In C++ they are less explicit via pure virtual functions. In AS3 they are only enforceable at runtime. There are many ways to go about creating abstract classes. This article shows you some of the ways.

Read the rest of this article »

2 Comments