O'Reilly logo

The Essential Guide to Physics for Flash Games, Animation, and Simulations by Adrian Dobre, Dev Ramtal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ActionScript 3.0 language basics

Classes are clever concepts but, as the last section showed, they are pretty useless by themselves. In this section, we'll review the code elements that do all the groundwork. Special emphasis is placed on their relevance to math and physics.

Variables and constants

Remember the var keyword that we used to declare properties? The keyword var stands for variable. A variable is a container that holds some value. Here value might mean different things. For example, the following variable x is defined to hold values that are numbers (we are omitting private keywords):

var x:Number;

Subsequently, x may only be assigned values that are numbers. For example:

x = 2;

This assignment can be done together with the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required