Hmm, they just return the <number> node from a matching asset in the
list, but if I do this:
var res : XMLList = _assets.child("number").(text() == prop);
if (0 != res.length()) {
trace(this, "getAssetDetails " + res[0].parent().childIndex());
return res[0].parent();
}
I still have the same problem even using the parent???
On 17/02/2011 11:24, Jens Struwe wrote:
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
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders