Copy link to clipboard
Copied
See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Proxy.html
First, it claims that Proxy used to be in flash.utils namespace, and is now a top-level class in Flash Player 11.
"Note: Prior to Flash 11 and AIR 3.0, the Proxy class was a member of the flash.utils
package. It is now a top-level class."
That seems to be the opposite of what's true. Proxy is now in flash.utils namespace and compiles properly when targetting Flash Player 11+. There is also no mention that you have to import the flash.utils.flash_proxy namespace explicitly to avoid a compile error.
Second, The description for the index parameter of the method nextNameIndex is ok:
index:int
— The zero-based index value where the enumeration begins.
But nextNameIndex is first called with zero to start the enumeration and the first value it returns is 1. That returned value is then passed to either nextValue or nextName to return the next value or next name, so the description for thier index parameter should say that it's one-based, not zero-based.
For example, the sample source code for overriding the nextName property is:
override flash_proxy function nextName(index:int):String {
return _item[index - 1];
}
The description for the index parameter is the same as the one for nextNameIndex:
index:int
— The zero-based index value of the object's property.
But that cannot be right, since the code is subtracting one from the index, which would try to access an index of -1 when zero is passed. Technically, none of the methods are zero-based. Althought one must first call nextNameIndex with a value of zero to return the first (next) index of 1, that is in fact the first index value, which is one-based, and both the other methods nextName and nextValue must be passed 1 to return the first name or value, and will throw an exception of passed zero.
Finally, nextNameIndex, nextName, and nextValue all use the same example (with nextNameIndex and nextName) so it's not applicable to nextValue.
So that documentation is just plagued with errors. How do they expect anyone to use the feature?
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now