In programming, a class is used to create and group objects with similar properties. AS3 comes with many predefined classes, but not all are used as commonly as the MovieClip class. MovieClips are very flexible and have the properties of other classes such as the Button and Graphic classes. Almost all of the classes I use are extensions of the MovieClip class, so for this project, they are essentially the same thing.

This is what an extremely basic class in an Actionscript file would look like:

package
{
    import flash.display.MovieClip;
 
    public class MyClass extends MovieClip
    {
        public function MyClass()
        {
 
        }
    }
}
This class only has a constructor function in it and no code so it pretty much does nothing at all. but we can see what each line would do if it did do something.

package
{
 
}
this allows a programmer to organize code into groups that can be exported to other scripts.
import flash.display.MovieClip;
this allows the programmer to use the properties of the MovieClip Class.

public class MyClass extends MovieClip
{
 
}
This is where the class is defined. the computer is told that the "MyClass" class will be an extension of the MovieClip class. this means that the programmer will be essentially making a copy of the MovieClip class in order to make changes to it.

public function MyClass()
{
 
}
This is the class Constructor. It is designed to give values to the properties of all new objects declared from the class.
Main Page