About Data Types - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Some of the most common kinds of data include strings (a sequence of characters, such as
names and passages of text), numbers, objects (such as movie clips), Boolean values (
), and so on. In this chapter, you'll also learn about the data types in Flash and how to
false
use them.
For information on types of data, see
variables, see
"About variables" on page

About data types

A data type describes a piece of data and the kinds of operations that you can perform on it.
You store data in a variable. You use data types when creating variables, object instances, and
function definitions to assign the type of data you're working with. You use many different
data types when you write ActionScript.
ActionScript 2.0 defines several commonly used data types. Data types describe the kind of
value that a variable or ActionScript element can contain. A variable that is assigned a data
type can only hold a value within that data type's set of values. For information on variables,
see
"About variables" on page
ActionScript has numerous basic data types that you will probably use frequently in your
applications. See the table in
information.
ActionScript also has core classes, such as Array and Date, that are considered complex or
reference data types. For more info on complex and reference data types, see
and complex data types" on page
ActionScript 2.0 Language Reference.
You can also create custom classes for your applications. Any class that you define using the
class declaration is also considered a data type. For more information on core and other built-
in classes, see
"About top-level and built-in classes" on page
creating custom classes, see
In ActionScript 2.0, you can assign data types to variables when you declare them. The data
types you assign can be any of the core types or can represent a custom class that you created.
For more information, see
When you debug scripts, you might need to determine the data type of an expression or
variable to understand why it is behaving a certain way. You can do this with the
and
operators (see
typeof
You can convert one data type to another at runtime using one of the following conversion
functions:
,
Array()
Boolean()
72
Data and Data Types
"About data types" on page
86.
86.
"About primitive and complex data types" on page 73
73. In addition, all data types and classes are fully defined in
Chapter 7, "Classes," on page
"About assigning data types and strict data typing" on page
"About determining data type" on page
,
,
Number()
Object()
72. For information on
286. For more information on
225.
85).
,
.
String()
and
true
for more
"About primitive
81.
instanceof

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents