houxq / flash-console

Automatically exported from code.google.com/p/flash-console
0 stars 0 forks source link

CommandLine: Not reliable to access XML content #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Can't call methods such as 'name()' because command line would try to access 
property 'name' ... then execute that property as a function. However, as in 
XML, property 'name' would return an XMLList of node called 'name', 
commandline will fail when treating it as a function.

Another problem is that you can't access children of array or XMLList in 
commandline (used to be able to but regressed in 2.0).

Original issue reported on code.google.com by luay...@gmail.com on 30 Oct 2009 at 10:11

GoogleCodeExporter commented 8 years ago
var xml:XML = <head><nodes><node>Node 1</node><node>Node 
2</node></nodes></head>;
trace(xml.name()); // head
// Commandline works out a method in the order below...
trace(xml["name"], getQualifiedClassName(xml["name"])); // blank, XMLList
trace(xml["name"]()); // blank XMLList isn't a function...therefore ERROR...

Can anyone help me with this?

Original comment by luay...@gmail.com on 30 Oct 2009 at 12:14

GoogleCodeExporter commented 8 years ago
Found the answer.. thanks to live-docs :/
These functions are under AS3 namespace, so to call methods under this 
namespace:

var X:XML = <a><b c='ccc'>ddd</a>;
trace(X.AS3::['name']());

Original comment by luay...@gmail.com on 4 Jan 2010 at 9:03