var validator:XML = <website>
<section>
<page />
</section>
</website>;
This XML 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.internalDropEnabled = true;
tree.validator = validator;
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 validator:XML = <website>
<section>
<section>
<page />
</section>
<page />
</section>
</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 validator:XML = <website>
<section>
<section>
<page />
</section>
<page />
</section>
<sitemap immovable="true" />
</website>;
var validator:XML = <website>
<section>
<section>
<page />
</section>
<page />
</section>
<sitemap immovable="true" unique="true" />
</website>;
var validator:XML = <website unclosable="true">
<section>
<section>
<page />
</section>
<page />
</section>
<sitemap immovable="true" unique="true" />
</website>;
var validator:XML = <website unclosable="true" uneditable="true">
<section uneditable="true">
<section uneditable="true">
<page />
</section>
<page />
</section>
<sitemap immovable="true" unique="true" uneditable="true" />
</website>;
var validator:XML = <website unclosable="true" uneditable="true">
<section uneditable="true" alwaysBranch="true">
<section uneditable="true" alwaysBranch="true">
<page />
</section>
<page />
</section>
<sitemap immovable="true" unique="true" uneditable="true" />
</website>;
var validator:XML = <website unclosable="true" uneditable="true">
<user invisible="true" />
<section uneditable="true" alwaysBranch="true">
<section uneditable="true" alwaysBranch="true">
<page />
</section>
<page />
</section>
<sitemap immovable="true" unique="true" uneditable="true" />
</website>;