这是我的一点意见。由于我是代码BC,可能会对某些词解释不到位,还望海涵。首先便是那个override
更改了的部份是我自己的理解,未更改部份就直接照抄了。嘿嘿~~
The Proxy class lets you override the default behavior of ActionScript operations (such as retrieving and modifying properties) on an object.
Proxy类可以让您覆盖对象上在ActionScript操作(例如重新获取和修改参数)的默认行为。
The Proxy class has no constructor, and you should not attempt to instantiate Proxy. Instead, subclass the Proxy class to override methods such as getProperty and provide custom behavior. If you try to use a method of the Proxy class without overriding the method, an exception is thrown.
Proxy类没有构造函数,所以你别想得到他的实例.相反的,将Proxy分成子类来覆盖方法,例如getProperty并提供自定义行为。如果您尝试使用Proxy类的方法而不覆盖其方法,则会产生例外。
And, keep in mind, your own code overriding the methods of the Proxy class can throw exceptions unintentionally. Throwing exceptions when using these methods causes problems because the calling code (using operators like in, is, delete and others) does not expect exceptions. Unless you're already sure your overriding method does not throw exceptions, Adobe recommends using try..catch statements around your implementation of the Proxy class to avoid fatal errors when operators call your methods.
你要注意,你自己的代码覆盖Proxy类的方法会导致不可交互例外。当使用这些方法导致问题产生例外,是因为调用代码(使用操作符例如in, is, delete或其它)不期望例外。除非您已经确信你覆盖的方法不会产生例外。Adobe建议当操作符调用你的方法时使用Proxy类执行的try..catch语句来防止致命错误的产生。
The Proxy class is a replacement for the Object.__resolve and Object.addProperty features of ActionScript 2.0, which are no longer available in ActionScript 3.0. The Object.addProperty() feature allowed you to dynamically create get and set methods in ActionScript 2.0. Although ActionScript 3.0 provides get and set methods at compile time, you cannot dynamically assign one to an object unless you use the Proxy class.
Proxy类是ActionScript 2.0 中Object.__resolve and Object.addProperty功能的替代,然而它在ActionScript 3.0上已经不可用。AS2中的Object.addProperty()方法允许你动态的创建get/set方法.虽然AS3提供了get/set方法供你在编译环节使用,但若不使用Proxy类,你是不能动态的给对象添加get/set方法的.
To avoid collisions with the public namespace, the methods of the Proxy class are in the flash_proxy namespace.
为了避免在公共命名空间中发生致命冲突,Proxy类的方法被放进了flash_proxy命名空间中.
Where methods of the Proxy class take a name argument, name can be either a String or a QName object (if namespaces are being used).
在Proxy类方法产生名称冲突的地方,名称可以是String或QName对象(如果名称空间被使用)。
callProperty(name:*, ... rest):*
Overrides the behavior of an object property that can be called as a function.
覆盖对象参数行为被称为一个函数。
deleteProperty(name:*):Boolean
Overrides the request to delete a property.
覆盖删除参数的请求。
getDescendants(name:*):*
Overrides the use of the descendant operator.
覆盖派生操作符的使用.
getProperty(name:*):*
Overrides any request for a property's value.
为参数值覆盖所有请求。
hasProperty(name:*):Boolean
Overrides a request to check whether an object has a particular property by name.
覆盖检查一个对象是否在名称上有特殊参数的请求。
isAttribute(name:*):Boolean
Checks whether a supplied QName is also marked as an attribute.
查询一个QName是否同时被标记为属性.
nextName(index:int):String
Allows enumeration of the proxied object's properties by index number to retrieve property names.
通过索引数字允许proxied对象参数的列举来重新获取参数名称。
nextNameIndex(index:int):int
Allows enumeration of the proxied object's properties by index number.
通过索引数字来允许proxied对象参数的列举。
nextValue(index:int):*
Allows enumeration of the proxied object's properties by index number to retrieve property values.
通过索引数字允许proxied对象参数的列举来重新获取参数值。
setProperty(name:*, value:*):void
Overrides a call to change a property's value.
覆盖调用来更改参数值。
[
本帖最后由 Togetherlllll 于 2007-6-8 17:21 编辑 ]