Wednesday, March 5th, 2008

Category: Misc

Sorry about the MXNA spewage


Comments Off

Tuesday, March 4th, 2008

Category: FlashCategory: Flex

Proxy/XML + [] = broken

There’s an issue with the Proxy and XML classes when you use the [] syntax to execute methods.

For example, this is the working behaviour:

var g:Function = myProxy.go; // calls getProperty on the Proxy subclass
myProxy.go(); // calls callProperty on the Proxy subclass

This is the non-working behaviour:

var g:Function = myProxy['go']; // calls getProperty on the Proxy subclass
myProxy['go'](); // calls _getProperty_ on the Proxy subclass

In the second example the second line calls getProperty. So why is that a big deal? Two things: first, it’s not consistent with non-[] syntax, and second, it calls getProperty so you don’t know that the user is actually calling a method.

This was reported to Adobe on JIRA (Calling a method on a subclass of proxy dynamically invokes getProperty rather than callProperty) and after months of inactivity it was finally concluded that this is not a bug. Why? Here’s the example that was given:
(more…)