Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

senocular.com ActionScript Library

getIndexInParent.as

1
2
3
4
5
6
// gets the index of the current node in its parent's childNodes array
XMLNode.prototype.getIndexInParent = function(){
	var i = 0, node = this;
	while (node = node.previousSibling) i++;
	return i;
}