O'Reilly logo

Fundamentals of ActionScript 3.0: Develop and Design by Doug Winnie

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

9. Building Out the Class

In the last chapter, you learned what a class is, created a RedButton class file, and linked it to the Library object; but you didn’t step through the code to analyze what it was doing or how it was doing it. So, let’s do that now and add to it the code to define how the red button looks and behaves.

Parts of a Class

All classes have a few basic parts. Take a look at the RedButton class code and dissect what the parts of the code do:

package  {    import flash.display.MovieClip;    public class RedButton extends MovieClip {        public function RedButton() {            // constructor code        }    }}

Package Statement

The first part is the package statement. All classes are grouped into categories called packages ...

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