1 Reply Latest reply on Apr 24, 2010 10:37 AM by johnvjohn

    Interaction between a TreeView component and Loader

    johnvjohn Level 1

      Hi,

       

      This is my first post at this forum. I have quite a complex task at hand. I have to create a set of 25/30 videos that needs to be played through Flash. I am using TreeView component to show the user the complete list of videos, this works fine. I also have a Loader component which will finally display the selected video from the TreeView.

       

      How do I link both these components ? so that when the users selects an option on the list, the corresponding video is played.

       

      This is the code I use now:

       

      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);

       

       

       

      This is the XML I use now:

       

      <node>
          <node label="Products">
          <node label="Tryout">
                  <node label="Segment2" isBranch="true" data="segment2.swf" />

                   .

                   .

                   .

            </node>

          </node>

      </node>

       

       

      Experts, please help me by showing a few code samples. I googled on the net, but not much luck...