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

 

senocular.com ActionScript Library

explodeIntoParent.as

1
2
3
4
5
6
7
8
9
// removes a node but leaves all child nodes it contained in its place
XMLNode.prototype.explodeIntoParent = function(){
	if (!this.parentNode) return false;
	while (this.hasChildNodes()){
		this.parentNode.insertBefore(this.firstChild, this);
	}
	this.removeNode();
	return true;
}