var validatorStr:String = "";
validatorStr += "<website>";
validatorStr += "<section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "</website>";
This string simply signifies that the root node will ALWAYS be website and it will hold section nodes. section nodes, in turn, will hold page nodes. It's important to understand that each node in this validator string represents a node type, not specific nodes. ANY node with a nodename of "section" will abide by the rules specified in the section node of this structure.
tree.draggable = true;
tree.validator = "validatorStr";
NOTE: the validator property takes the name of the validator string, not the validator string itself.
With the validator set up for the component, the tree will ONLY allow section nodes to be dropped into website and will ONLY allow page nodes to be dropped into section nodes. Any other drop will be considered invalid and prevented.
var validatorStr:String = "";
validatorStr += "<website>";
validatorStr += "<section>";
validatorStr += "<section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "</website>";
Now we have enabled sections to be both inside the website node or any other section node. page nodes still can only reside within section nodes.
var validatorStr:String = "";
validatorStr += "<website>";
validatorStr += "<section>";
validatorStr += "<section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<sitemap immovable="true" />";
validatorStr += "</website>";
var validatorStr:String = "";
validatorStr += "<website>";
validatorStr += "<section>";
validatorStr += "<section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<sitemap immovable="true" unique="true" />";
validatorStr += "</website>";
var validatorStr:String = "";
validatorStr += "<website unclosable="true" >";
validatorStr += "<section>";
validatorStr += "<section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<sitemap immovable="true" unique="true" />";
validatorStr += "</website>";
var validatorStr:String = "";
validatorStr += "<website unclosable="true" uneditable="true" >";
validatorStr += "<section uneditable="true" >";
validatorStr += "<section uneditable="true" >";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<sitemap immovable="true" unique="true" uneditable="true" />";
validatorStr += "</website>";
var validatorStr:String = "";
validatorStr += "<website unclosable="true" uneditable="true" >";
validatorStr += "<user invisible="true" />";
validatorStr += "<section uneditable="true" >";
validatorStr += "<section uneditable="true" >";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<page />";
validatorStr += "</section>";
validatorStr += "<sitemap immovable="true" unique="true" uneditable="true" />";
validatorStr += "</website>";