Chapter 4. Primitive Datatypes

Primitive data consists of simple characters or keywords such as the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or the strings “a”, “b”, “c”. As we learned in the previous chapter, the primitive datatypes supported by ActionScript are number, string, boolean, undefined, and null. In this chapter we’ll learn how to define, examine, and change data of each type.

The Number Type

Numbers are used for counting, mathematics, and to keep track of numeric properties in our movies (like the current frame of a movie clip or its location on the Stage). Let’s see how numbers are defined and manipulated in ActionScript.

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.