namespace
² internal namespace
| Public | Private | Protected | Internal (default) |
Same package | Y | - | - | Y |
Diff. package | Y | - | - | N |
Same class | Y | Y | Y | - |
derived classes | Y | - | Y | - |
Danamic – 在运行时可通过添加或更改属性和方法来改变对象。e.g.
dynamic class Protean {}
var myProtean:Protean = new Protean();
myProtean.aString = "testing";
myProtean.aNumber = 3;
myProtean.traceProtean = function () { trace(this.aString, this.aNumber); };
myProtean.traceProtean(); // testing 3
Note: 对于 Protean 类的任何私有属性或方法都不具有访问权限。
override – 重新定义继承的方法或属性
final – 禁止子类覆盖
static – Specifies that a property belongs to the class, as opposed to instances of the class.
UserDefinedNamespace – Custom namespace name defined by user.
² custom namespace
define namespace: namespace xxx;
define property / method: xxx function myFunction(){}
use-1: use namespace xxx; myFunction();
use-2: xxx::myFunction();
e.g.
package flash.utils { public namespace flash_proxy; class Proxy { flash_proxy myFunction() {} } } |
² name of namespace
e.g.
public namespace flash_proxy = "http://www.adobe.com/flash/proxy";
如果您省略 URI,编译器将创建一个唯一的内部标识字符串来代替 URI。您对于这个内部标识字符串不具有访问权限。
Detail: http://help.adobe.com/zh_CN/as3/learn/WSf00ab63af761f170-4ed0731912937da73f7-7ffe.html