Adobe does not specifically describe some basic differences in the official English documents. Most of them are automatically translated or translated into Chinese, and there are some improper translations. the Ancients have clouds, but the difference is only a thousand miles. First, let's try to ask, what is the difference between function and method?
Function and method are translated into Chinese. I do not know how to translate them. It is better to use English. In as3, a function is a keyword defining a function, but it does not necessarily define a function or method.
1. Differences between method and Function
The method explicitly defined using the function keyword in the class is called the method. In addition, all the methods defined using the function keyword are called
Function. Function is similar to the Function Method in Js. This distinction helps to understand the concept of closure (closure) in as3.
2. What is property?
In as3, property should not be understood as a class attribute, but should be understood as a class element, including variables, methods, and setter/getter methods. From a perspective
In as3, the class has no attributes. the commonly used X, Y, width, and height cannot be called "attributes". They are setter/getter methods. In this way
Helps you understand trait objects.
3. What is type annotation )?
The translation of Type annotation into type declaration is not straight, and type annotation is only used by the compiler,CodeAlthough the amount increases, the performance improvement and code readability are in exchange. This is similar to the annotation function, and the translation for Type annotations is more appropriate.
VaR S: String = "sban ";
In the preceding example, string is a type comment or a variable type comment.
Public Function getwidth (): uint
{
//...
}
In the preceding example, uint is a type comment or a type comment.