Author: Ashwinee Kumar Dash.
Name of the Book: Essential ActionScript 3.0 by Colin Moock
Disclaimer: Anything in quotation marks is a direct quotation from Essential
ActionScript 3.0. All other notes are my own summaries of the concepts
presented in the book.
These notes are for reference purpose only and not intended to replace the book .Therefore I would strongly advise you to read the original book as well as make your own notes wherever necessary.
Send your suggestions and feedbacks to aswhineedash[at]gmail[dot]com or aswhinee2004[at]gamil[dot]com.
Static Variables and Methods
- Static variables are class variables, not instance variables. Static variables do not vary from instance to instance
- Static keyword defines the variable to be a class variable
- Four access control modifiers available and they are public, private, internal and protected. These modifiers come before the static keyword.
- Inside the class static variables can be used as regular variables. But otherwise it has to be accessed by using className.variable.
- Inside a class a static variable and an instance variable of same names can coexist.
- Constant is a variable with a value that do not change throughout the program
- It is defined using the keyword const in stead of var
- Like static variables, static methods define functionality that relate to an entire class.
- Static methods cannot use the keyword this.
- Static methods cannot access instance variables and instance methods of the class where it is defined. quite logical.
- When ActionScript creates a class at runtime, it creates a method called class initializer and runs it.
- In the class initializer it places all the static variables and all class level code that is not instance variable or instance method.
- Every class in ActionScript is represented at runtime as an instance of the Class class.
- Class objects are primarily used to access static properties and static methods.
- Like other objects class objects can be used as values for assigning and return type.