Welcome, Guest
  • Author Topic: tree open close/nodes problem  (Read 6386 times)

    lambda

    • Server what's that
    • *
    • Posts: 13
      • View Profile
    tree open close/nodes problem
    « on: 04/04/08, 12:23 »
    Hi all
    a question again here.
    I made a tree driven by xml skinned and transparent; but the problem seems that the prototype that drives the opened/closed status of the nodes/branches gets a white square during the refresh of data (if you scroll for example a long branch) .

    The code is the following:
    /**
     * Verify if the current XMLNODE is a child node
     * of the passed node
     */
    XMLNode.prototype.isChildNodeOf = function (targetParent:XMLNode) {
       var ret:Boolean = false;
       var myParent:XMLNode = this;
       while (myParent.parentNode != undefined) {
          if (myParent == targetParent) {
             ret = true;
             break;
          }
          myParent = myParent.parentNode;
       }
       return ret;
    };

    /**
     * Return a list of sibling nodes of the parent node
     */
    XMLNode.prototype.getBrotherChilds = function (cTree:mx.controls.Tree) {
       var parent = this.parentNode;
       for (var a = 0; a < parent.childNodes.length; a++) {
          if (parent.childNodes[a] != this and cTree.getIsOpen (parent.childNodes[a])) {
             return parent.childNodes[a];
          }
       }
       return undefined;
    };


    hope it is clear enough.
    any suggestion?
    Thanks in advance.
    Lambda

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: tree open close/nodes problem
    « Reply #1 on: 04/04/08, 16:33 »
    This code has nothing to do with the visual part, it just lookup an XML to see if it has childres and to get the parents

    Jorge

    lambda

    • Server what's that
    • *
    • Posts: 13
      • View Profile
    Re: tree open close/nodes problem
    « Reply #2 on: 04/05/08, 00:32 »
    thank you jorge, as usual for your prompt replies

    but if this is not the problem, what else? another bug in this component?
    I made a lot of attempts. Without the script and his references even with easing in the tree the folders open and close fine, but my scope is to have all the the other root folders closed (and sub folders)  when i open a new root folder.

    The problem is that i have to put the tree in a very little vertical space (150px h) and this action was very useful to.
    I've tried with a for loop but with no success (same problem).
    Do you  have any suggestion?
    thank you for your great support!
    [P.s. The Flash component is a very weird thing!]

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: tree open close/nodes problem
    « Reply #3 on: 04/05/08, 08:46 »
    If is the standard Tree component, sounds strange the problem. Flash is slow in parsing strings, but should be massive data to interfere with the screen refresh routine. If your XML is huge, probable many of the methods slow down, also making the all thing slow. Did you try with a small XML? The same happens?

    Jorge

    lambda

    • Server what's that
    • *
    • Posts: 13
      • View Profile
    Re: tree open close/nodes problem
    « Reply #4 on: 04/06/08, 00:43 »
    Hi
    the answer is yes, is the standard component! I tried even with the one modified by sephiroth and with a brand new file in flash cs3 in native As2; same behavior...
    btw, the xml in effect is quite long (i mean that it has 3 levels of folder at least)...
    I will try as you suggested and in this case i will give up!  :'(

    thank you jorge, i'll let you know.
    L