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:
Archive for July, 2009
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.
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…
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.
Scoping is pretty weird in AS3 for those coming from C/C++ and Java. There are two cases in particular you should know about.
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.
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.
Like Java, AS3 has a super() function you can call from your constructor to call your parent class’ constructor. As it turns out, this is more optional than you might think.
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.