Posts Tagged cast

Object Creation: Part II

Tags: , , , , , ,

As a followup to the previous article about object creation and a comment about an alternate object creation strategy, today’s article will expand the coverage of object creation. I will also discuss the performance (and generated bytecode) for creating non-empty objects to see if there are any redeeming factors to the “curly braces” (o = {}) approach.

Read the rest of this article »

7 Comments

Declaring Vectors

Tags: , , , , , ,

The differences between Vector and Array have been quite interesting since Vector was introduced in Flash Player 10. Until just recently I didn’t know that there was special syntax for declaring a Vector akin to Array's special a = [1,2,3,4,5] trick. This got me thinking about the various ways one can declare a Vector and, of course, how they’re implemented in bytecode and what the speed differences, if any, are. Read on for some nitty gritty about how you declare Vectors in AS3.

Read the rest of this article »

26 Comments

Making Vectors Out Of Mixed-Type Arrays

Tags: , ,

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