There are many ways that you can use to check the child existence for XML in AS3. Consider we have a data XML that we need to determine whether “video” node is existed or not:

var myData:XML =
<data>
<item id=”0″>
<video>example.flv</video>
</item>
<item id=”1″>
<image>example.jpg</image>
</item>
</data>;

trace(”Item with id = 0″);
trace(myData.item.(@id == 0).video != undefined);
trace(myData.item.(@id == 0).child(”video”) != undefined);
trace(myData.item.(@id == 0).child(”video”).length());
trace(”video” in myData.item.(@id […]

continue reading.....