PDA

View Full Version : tree component & loadMovie


TimothyMGT
01-17-2006, 03:57 PM
hello i have a question about the tree component and loadMovie
//
on the stage i have a tree component
& here is the script to pooulate it

var myTreeDP:XML = new XML();
myTreeDP.ignoreWhite = true;
myTreeDP.load("http://www.mySite.com/XML.xml");
myTreeDP.onLoad = function() {
tree_comp.dataProvider = this.firstChild;
};

and this code to listen for events

var treeListener:Object = new Object();
treeListener.change = function(evt:Object) {
_root.holder_mc.contentPath = evt.target.selectedNode.data;
_root.holder_mc.loadMovie();
};
tree_comp.addEventListener("change", treeListener);

also this code populates the tree NP i cannot figure why this wont call / load a swf and load it in the container ( holder_mc ) on the stage in the same swf -?


sample of the XML --

<node label="Info" data="http://www.mySite.com/some.swf" isBranch="true" />


thanks for the help
cheers .

Paerez
01-17-2006, 06:50 PM
pretty sure its:

_root.holder_mc.contentPath = evt.target.selectedNode.attributes["data"];

TimothyMGT
01-17-2006, 07:47 PM
yePP m8 ..
here it is what i got it to workwith

_root.holder_mc.loadMovie(evt.target.selectedNode. attributes.data, _root.holder_mc);


cheers for the reply though . :D

Paerez
01-17-2006, 08:08 PM
yeah for XML you have to go through the attributes property to get to the data, which is unlike all other MM components, but it makes sense. Glad you got it to work.