# TreeView Component and Loader

**URL:** https://forum.kirupa.com/t/treeview-component-and-loader/308403
**Category:** flash
**Created:** [April 22, 2010, 10:42am UTC](https://forum.kirupa.com/t/treeview-component-and-loader/308403 "2010-04-22T10:42:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![trumpet](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@trumpet](https://forum.kirupa.com/u/trumpet)
#### Post date: [April 22, 2010, 10:42am UTC](https://forum.kirupa.com/t/treeview-component-and-loader/308403/1 "2010-04-22T10:42:43Z")

</div>

Hi,  
I am building a series of videos(MOV) that going to be played using Flash. So I have a TreeView component that gets populated from a well defined XML document that has all the video names as nodes.

My use of this setup is to have the user select a link and the appropriate video comes up to play. I have a loader component also set up, but I want to link the TreeView’s output (or user selection on TreeView) to the Loader, so that the corresponding video plays.

Can i call the video directly ? (Assuming its going to be a FLV4 file?). If I create the entire video in flash (create the product demo in flash) can i call the resulting swf ?

Please help

Here’s an update:

I have a Flash AS2.0 file in which I have a TreeView component, that gets its data from this XML. I also have a loader component to house the resulting SWFs.  
[XML]  
\<node\>  
\<node label=“Products”\>  
\<node label=“Tryout”\>  
\<node label=“Segment2” isBranch=“true” data=“segment2.swf” /\>  
\</node\>  
\</node\>  
\</node\>  
[END XML]

The component comes up fine, it displays the list correctly, but what I want to do is to have the segment2.swf play when the users selects the same from the list. So there needs to be a way to tell the loader that it’s input comes from the list. How to do this ?

This is the code that I have at present :

```auto

var myTreeDP:XML = new XML();
myTreeDP.ignoreWhite = true;
myTreeDP.load("treeXML.xml");
myTreeDP.onLoad = function() {
    myTree.dataProvider = this.firstChild;
};
var treeListener:Object = new Object();
treeListener.change = function(evt:Object) {
    trace("selected node is: "+evt.target.selectedNode);
};
myTree.addEventListener("change", treeListener);

```

any help is appreicated
