4

Variables, “If”, “For” and “While” Loops

Variables

In order to retrieve and manage information we need to store data as variables; this is the primary information storage container of ActionScript. A variable is a container that stores a piece of data. The container itself is always the same, but the contents can change. Variables can be used to store information as the movie plays and can be used for many situations, such as to change the behavior of the movie based on the user interaction. I always liken a variable to a bank account, but instead of holding money it holds data. When you create a new variable it is like setting up a new account, so your new data is stored in another location different from the previous data. All you have to ...

Get Understanding Flash MX 2004 ActionScript 2 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.