Archive for category JavaScript

Clearing an Array or Vector

Tags: ,

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

5 Comments

Spot The Problem

Tags: ,

You could probably do this in most languages and it might be hard to spot. See for yourself.

Read the rest of this article »

2 Comments

Null and Undefined

Tags:

Usually languages just have one way to specify “no value”. Call it null or nil or whatever you’d like, but AS3 and JavaScript have two: null and undefined. Here’s a little bit to help you understand when and why you’ll come across the two as well as some tricky differences between them.

Read the rest of this article »

1 Comment

The Truth of Strings

Tags: ,

What strings are true? The answer may surprise you.

Read the rest of this article »

No Comments

Fancy Or

Tags: ,

The lowly || operator in the hands of AS3 and JavaScript is not so lowly. Here’s a quick time saver.

Read the rest of this article »

4 Comments

Triple Equals

Tags:

Anyone coming from a language like C that doesn’t have a === operator seems shocked when they encounter such a ludicrous operator. For them, and for anyone being a bit careless, simple usage of === can really bite you.

Read the rest of this article »

3 Comments

Missing Array Elements

Tags:

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

No Comments

ActionScript 3 Loops

Tags:

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

3 Comments