• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. Basic ActionScript > Managing Variables, Data, and Datatypes

Managing Variables, Data, and Datatypes

A variable is a name that you assign to a datum (data item). It's called a variable because what it names can vary. For instance, a variable named myScore may equal 10 now. A moment later, after you've scored a point in a game, myScore may equal 11. However, in ActionScript, the variability of variables can go far beyond that: Unless you use strict data typing, you can assign different types of values to the same variable. For example, myScore could represent the number 11, then the string "foo", and finally an array of strings and numbers.

Unintentionally changing a variable's data type can lead to errors. Strict data typing helps you avoid this potential problem, which is why strict data typing is one of the most important new features in ActionScript 2 (AS2).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint