Lesson 6. Custom Classes
As an ActionScript programmer, you can create an unlimited variety of applications. The more experience you gain, the more you'll realize how often you end up writing code that performs certain custom tasks over and over a...
What You Will Learn
In this lesson, you will:
Learn class syntax and terminologyLearn about class paths and how they're usedLearn about private, public, and static members and how to use themUse inheritance to extend a classUse overridingCreate c...
Understanding Classes, Top-Level Classes, and Instances
A class is a definition or blueprint of how an object is made up and how it should act. For example, an instance of the Array class (an Array object) can store multiple pieces of information ...
Creating a Class
The code for defining an ActionScript class exists in its own .as file (remember that the .as file extension stands for Action Script). Only one class can be defined per file. If you create 13 classes, you have to create 13 .as fi...
Understanding the Classpath
So far you have been introduced to the basics of the class syntax and creating a class file. What you haven't yet learned is how class files relate to Flash authoring fileshow they're used in tandem.
If you want to use...
Using Packages and Importing Classes
You have learned that a classpath points to one or more directories. Each of these directories can contain class (.as) files. In addition to containing class files, a classpath directory can contain subdirector...
Using Getters and Setters
As you're well aware by now, when you create an instance of a class you're actually creating an object. Often these objects have properties, as defined by their class files. For example, look at this class definition:
...
Defining Members
Not all class members are created equal. Using special keywords, members can be configured in various ways, allowing you to specify how the member is accessed and the scope of its influence. Next, we'll discuss what this means and...
Understanding Inheritance
A class can gain (inherit) all members from another class. This is called inheritance. The class that's gaining the members is called a subclass, and the class from which it inherits is called the superclass. If B is a su...
Updating an Inheritance-Based Project
We're not finished quite yet. To help solidify your understanding of inheritance, we'll make a few enhancements to the Animal class so you can see how easy it is to update an object-oriented/inheritance-based ...
What You Have Learned
In this lesson, you have:
Explored the terminology and syntax of classes (pages 127132)Learned how to use classpaths (pages 132139)Used getters and setters (pages 139142)Learned about private, public, and static members, and...
AJAX popular information C# language guides Windows books and cookbooks
.......
С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.