Try:

var res : XMLList = _assets.child("number").(text() == prop);
var res:XMLList = _assets.*.(attribute("icon") == String(prop));

Jens


Am 17.02.2011 11:08, schrieb Glen Pike:
Hi,

I am having a problem with getting the childIndex value from an e4x result:

Both these functions work - e.g. they return an XML node from a list,
but the childIndex property always traces as -1 for the first function.

Can anyone see what the problem is?

TIA

Glen

public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(child("number") == String(prop));
if (0 != res.length()) {
debug(this, "getAssetDetails " + res[0].childIndex());
return res[0];
} else {
return null;
}
}

override public function getAssetDetails(prop:*):XML {
if (!_assets) {
return null;
}
var res:XMLList = _assets.(attribute("icon") == String(prop));
if (0 != res.length()) {
debug(this, "getAssetDetails " + res[0].childIndex());
return res[0];
} else {
return null;
}
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to