Suppose a few facts:
Livedocs tells us that classes dynamicallow us to add member variables and member functions. We are told that all classes ultimately stem from Objectwhich dynamic, and that classes dynamicshould be explicitly marked as such - inheritance does not extend to dynamism.
An object is a class dynamic. Date is a class final dynamic. XML is a class final dynamic. You can create your own class final dynamic, and he should behave (in terms of the dynamic capabilities) in the same way as XMLand Dateabove. Actually, finalit should not affect the problem at hand, but I include it for accuracy in my comparison with the "problem" XMLclass.
My code is:
public static function setup():void//Object
{
o.foo = function():String
{
return "Works as expected.";
}
trace(o.foo());
}
, o:
: Works as expected.
MyFinalDynamicClass: Works as expected.
: Works as expected.
XML: TypeError: Error #1006: value is not a function.
Date, , final dynamic. , - . - XML.
, AS3 Object, , , , - ++, , , , Adobe AS .
: ? ?
P.S. , , XML, XML.