ActionScript 3.0 classes

If you've programmed using an earlier version of ActionScript before version 3.0, chances are you haven't worried too much about classes. However, in AS3.0 it is impossible to ignore classes, because they are built into the very structure of the language. So what is a class?

A class is a fundamental construct of object-oriented programming (OOP). It is an abstract specification of an object that you want to create. An object is anything that exists in your movie at runtime.

Now that sounds pretty abstract, so let's look at an example. Suppose you want to create particles in a project, and the particles will be the objects. How will Flash know how to make particles? Well, you'll first have to tell it what a particle consists ...

Get The Essential Guide to Physics for Flash Games, Animation, and Simulations 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.