From the course: Learning ActionScript
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Arrays and vectors - ActionScript Tutorial
From the course: Learning ActionScript
Arrays and vectors
In ActionScript, Array is one of the most useful primitive data types that you will encounter. In this lesson, we'll have a look at how to create and manipulate normal AS3 Arrays along with typed Arrays called Vectors. An Array is a data structure, it is this thing of a collection of elements. Either values or variables each identified by at least 1 index. And you'll notice here in this class that we actually don't have to import Array or a Vector. This is because Array and Vector are both just primitive data types within ActionScript just like an Int or a String. So, the first thing we're going to do here are declare two private variables. One for an Array that we're calling My Array. And one for a Vector called My Vector. And you'll notice there's a bit of a difference here. Whereas, when we did a Type B Array. We do it just like any other object with an ActionScript. But when we did a type of Vector we have to actually give that Vector a specific data type assignment. So, that's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.