0 Replies Latest reply on Aug 9, 2010 12:26 AM by Rajiv_Sharma

    Tree view in flash

    Rajiv_Sharma

      Hello

       

      We prepare the flv player using flash AS2. I prepare the tree view as left nevigation to play the video files. the node of the tree should grey using ( my_tr.setStyle("themeColor", 0xCCCCCC);. When we click on the nodes of the tree. the color is apply it all the nodes and video is play.

       

      <?xml version="1.0" encoding="iso-8859-1"?>
      <tree>
      <folder label=" 1 Definite Articles..." url="Ch1Ls1Presentation_controller.swf">
      <video label="Video" url="Ch1Ls1Presentation_controller.swf"/>
      <video label="Classroom" url="Ch1Ls1Explaination_controller.swf"/>
      <video label="Practice" url="Ch1Ls1Practice_controller.swf"/>
      </folder>
      <folder label=" 2 Indefinite Articl... " url="Ch1Ls2Presentation_controller.swf" >
      <video label="Video" url="Ch1Ls2Presentation_controller.swf"/>
      <video label="Classroom" url="Ch1Ls2Explaination_controller.swf"/>
      <video label="Practice" url="Ch1Ls2Practice_controller.swf"/>
      </folder>

      </tree>

      When we click on the <video label="Video" .. the  video is play and left nevigation link is colored as grey, when we click on <video label="Classroom" the link color is appearing. This is working is fine in my code.

      My code

      var my_tr:mx.controls.Tree;

      var xml:XML = new XML();
      xml.ignoreWhite = true;
      xml.onLoad = function() {
      my_tr.dataProvider = this.firstChild;
      };
      xml.load("xml/TreeView.xml");
      var treeListener:Object = new Object();
      treeListener.change = function() {
      var item = my_tr.selectedItem;

      var myurl = item.attributes.url;
      if (myurl) {
        _root.Player_MC.Player_SWF.loadMovie("flash/"+myurl);
        if (myurl == "Ch1Ls1Presentation_controller.swf") {
         my_tr.setIsOpen(my_tr.getTreeNodeAt(0), true);
        }
        if (myurl == "Ch1Ls2Presentation_controller.swf") {
         my_tr.setIsOpen(my_tr.getTreeNodeAt(1), true);

      }
      }
      };

      my_tr.addEventListener("change", treeListener);

       

      Now my probelm is that -- when the first flv is playing complete means NetStream.Play.Stop this will automaticaly read the new file name in array and play it. bu in tree view the node 2 is not active means at this time the color of node one is change the  default color & node 2 is going to grey.

      Can some body help ?????