4 Replies Latest reply on Jun 4, 2006 6:23 PM by blueprnt

    Tree view not displaying labels

    blueprnt Level 1
      Hi,
      I am trying to use the Tree component, the tree view part is fine I can click on a folder and it expands click on the icon and it runs the preloader (component) and displays to pic fine. What it doesn’t do is display the text next to the folder or icon it is just blank. I have even tried copying the gallery_tree.fla (from \Flash 8\Samples and Tutorials\Samples\ActionScript\Galleries) and putting it in to my project with the same problem. So below are the xml file and the action script.

      Any help is appreciated
      BP

      Note: I am trying to use this in _root.blank_mc.menu3 (which is a movie clip)

      XML file

      <?xml version="1.0"?>

      <tree>
      <node label='Gallery 1'>
      <node label='DCP_0730' src="images/DCP_0730.jpg" />
      <node label='DCP_0731' src="images/DCP_0731.jpg" />
      <node label="DCP_0732" src="images/DCP_0732.jpg" />
      <node label="DCP_0733" src="images/DCP_0733.jpg" />
      <node label="DCP_0734" src="images/DCP_0734.jpg" />
      <node label="DCP_0735" src="images/DCP_0735.jpg" />
      <node label="DCP_0736" src="images/DCP_0736.jpg" />
      <node label="DCP_0737" src="images/DCP_0737.jpg" />
      <node label="DCP_0738" src="images/DCP_0738.jpg" />
      <node label="DCP_0739" src="images/DCP_0739.jpg" />
      <node label="DCP_0740" src="images/DCP_0740.jpg" />
      <node label="DCP_0741" src="images/DCP_0741.jpg" />
      <node label="DCP_0742" src="images/DCP_0742.jpg" />
      <node label="DCP_0743" src="images/DCP_0743.jpg" />
      <node label="DCP_0744" src="images/DCP_0744.jpg" />
      <node label="DCP_0745" src="images/DCP_0745.jpg" />
      <node label="DCP_0746" src="images/DCP_0746.jpg" />
      <node label="DCP_0747" src="images/DCP_0747.jpg" />
      </node>
      </tree>

      Action script

        • 1. Re: Tree view not displaying labels
          blueprnt Level 1
          Ok must harder than I thought.
          Using the flash sample gallery_tree I can get it to work on the mail timeline but not when I put it in _root.blank_mc.menu3 movie clip
          Any help out there??
          BP
          • 2. Re: Tree view not displaying labels
            blueprnt Level 1
            anyone out there with any sugestions? the problem is in the action script because it works on the mail time line but not in _root.blank_mc.menu3 which is were I need it.

            Action script below

            var my_pb:mx.controls.ProgressBar;
            var my_ldr:mx.controls.Loader;
            var my_tree:mx.controls.Tree;
            my_pb._visible = false;
            my_pb.indeterminate = true;
            my_pb.setSize(160, 30);
            my_pb.source = my_ldr;
            my_pb.mode = "polled";
            var pbListener bject = new Object();
            pbListener.complete = function(evt bject) {
            evt.target._visible = false;
            };
            my_pb.addEventListener("complete", pbListener);
            var treeDP_xml:XML = new XML();
            treeDP_xml.ignoreWhite = true;
            treeDP_xml.onLoad = function(success:Boolean) {
            if (success) {
            my_tree.dataProvider = this.firstChild;
            }
            };
            treeDP_xml.load("gallery_tree.xml");
            var treeListener bject = new Object();
            treeListener.change = function(evt bject) {
            var treeNode:XMLNode = evt.target.selectedItem;
            if (treeNode.attributes.src != undefined) {
            my_pb._visible = true;
            my_ldr.load(treeNode.attributes.src);
            }
            };
            my_tree.addEventListener("change",treeListener);

            stop();
            • 3. Re: Tree view not displaying labels
              Juankpro Level 2
              I think the other member don't answer you not becuase it is a problem hard to solve, but becuase nobody can get your code to fail. I am testing your code on many places, main time line, a movie clip and a movie clip inside a movieclip but it works.
              • 4. Re: Tree view not displaying labels
                blueprnt Level 1
                thanks juankpro that was a big help it let me know where to start looking, first I started deleating all the different scripts on the main timeline (it is compleate flash website) and found that it wasn't any of the action scrits causing it not to display. So the only thing left was the fact that it was in a mask. Once I moved it out of the mask it worked fine!!. But the thing is now how do I get it to work in a mask???? You can test this for yourself by opening the gallery_tree.fla in \Flash 8\Samples and adding a layer making it a mask (and making a box around the whole thing). So now I know what is causing the problem how can I fix it?
                BP