fileas
11-04-2003, 08:10 AM
I'm adapting the DDTree for a current project (for those that don't know it's a drag and drop version of the fTree component from flashcomponents.net) and i'm having a little difficulty!
basically I have two instances of the DDTree on the stage - one called 'myArticles' and one called 'mySiteStructure'. The idea is you drag the articles to the site structure and then output the xml of the nodes of the sitestructure (so it acts like a sort of content management system)
If you select a node on the tree (beit a branch/section or an article) the details of that node are displayed below. I've changed the doClick function as follows.
DDTreeClass.prototype.doClick = function(node){
trace(myTree.getRootNode().getLabel());
if (node.isBranch()) {
showSectionDetails();
} else {
showArticleDetails();
}
}
which then calls a function to display the details:
function showSectionDetails(){
hideArticleDetails();
mcSectionDetails.txtMenuLabel.text = mySiteStructure.getSelectedNode().getMenuLabel();
mcSectionDetails.txtSectionName.text = mySiteStructure.getSelectedNode().getLabel();
//more details added here.......
mcSectionDetails._visible = true;
}
the thing is i'd like it to show the details of the other tree too but at the moment i'm having to specify mySiteStructure.
SO the question is.... in the doClick function how do you know which tree had been clicked on and more importantly what the instance name of that tree is?? I guess it would be the same as working
any help would be much appreciated!
later
fil
basically I have two instances of the DDTree on the stage - one called 'myArticles' and one called 'mySiteStructure'. The idea is you drag the articles to the site structure and then output the xml of the nodes of the sitestructure (so it acts like a sort of content management system)
If you select a node on the tree (beit a branch/section or an article) the details of that node are displayed below. I've changed the doClick function as follows.
DDTreeClass.prototype.doClick = function(node){
trace(myTree.getRootNode().getLabel());
if (node.isBranch()) {
showSectionDetails();
} else {
showArticleDetails();
}
}
which then calls a function to display the details:
function showSectionDetails(){
hideArticleDetails();
mcSectionDetails.txtMenuLabel.text = mySiteStructure.getSelectedNode().getMenuLabel();
mcSectionDetails.txtSectionName.text = mySiteStructure.getSelectedNode().getLabel();
//more details added here.......
mcSectionDetails._visible = true;
}
the thing is i'd like it to show the details of the other tree too but at the moment i'm having to specify mySiteStructure.
SO the question is.... in the doClick function how do you know which tree had been clicked on and more importantly what the instance name of that tree is?? I guess it would be the same as working
any help would be much appreciated!
later
fil