Join Joseph Labrecque for an in-depth discussion in this video Variables, part of Getting Started with ActionScript.
In this lesson, we'll look at a common object within any programming language, …the variable. Variables and constants in Action script …are very similar to those found in many other languages. …A variable is basically a little piece of data that we are able to give a name to …so that we can both assign values to that data, and retrieve values from that data. …And serve as the basic building blocks to any program.…
So here we can see I have a class file already open, and what we're going to do …is declare a variable. And to do that normally this is done …directly within the class itself. And the way we do it is we can declare …that variable to be private or public or protected depending upon our needs. …Here we'll declare private. We'll use the keyword var and that's …going to declare the variable for us. And at this point we give the variable an …identifier, or a name. Let's just call this number.…
And in Action script we have to set this to a specific data type. …And variables can be set to really any data type that you want. …
- What is ActionScript and why should I learn it?
- ActionScript 2.0 vs. ActionScript 3.0
- Implementing external source code
- Working in Flash Professional and Flash Builder
- Understanding language fundamentals
- Working with ActionScript objects