Home > flex > cannot call ANY methods of XML or XMLList instances via bracket notation

cannot call ANY methods of XML or XMLList instances via bracket notation

Every single method, unique to XML and XMLList or inherited will be return as an empty XMLList instead of the intended method as a Function when its retrieved as a property of that instance. Note that this not calling XMLList methods but retrieving the actual methods as properties of the objects themselves.

For example:
myXML.contains is XMLList //true
myXML.toString is XMLList //true

This makes it impossible to call a method of an XML or XMLList programmatically via bracket notation like:
myXML['toXMLString']() //returns TypeError: Error #1006: value is not a function.

It feels like a Proxy is involved internally and these methods were not set to returning properly in getProperty. Anyone have any feedback or work arounds?

Categories: flex Tags:
  1. No comments yet.
  1. No trackbacks yet.