Hey just playing with the tree component and went through the help file for it. Thier tree was setup to perform a getURL and i wanted to change it to loadMovie. The problem was when pressed it actually wouldnt load into the clip that I wanted it to, instead it would load into the clip that holds the tree… No idea why it is doing that but.
It is suppose to load into mc_content but instead loads into menuTree i belive.
import mx.controls.Tree;
class TreeNavMenu extends MovieClip {
var menuXML:XML;
var menuTree:Tree;
function TreeNavMenu() {
// Set up the appearance of the tree and event handlers.
menuTree.setStyle("fontFamily", "_sans");
menuTree.setStyle("fontSize", 12);
// Load the menu XML.
var treeNavMenu = this;
menuXML = new XML();
menuXML.ignoreWhite = true;
menuXML.load("TreeNavMenu.xml");
menuXML.onLoad = function() {
treeNavMenu.onMenuLoaded();
};
}
function change(event:Object) {
if (menuTree == event.target) {
var node = menuTree.selectedItem;
// If this is a branch, expand/collapse it.
if (menuTree.getIsBranch(node)) {
menuTree.setIsOpen(node, !menuTree.getIsOpen(node), true);
}
// If this is a hyperlink, jump to it.
var url = node.attributes.url;
///THIS IS WHERE I MADE THE CHANGE ////
if (url) {
loadMovie(url, _root.mc_content);
trace(url);
}
// Clear any selection.
menuTree.selectedNode = null;
}
}
function onMenuLoaded() {
menuTree.dataProvider = menuXML.firstChild;
menuTree.addEventListener("change", this);
}
}
Any help would be cool.
Thx alot.