Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 08:36
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  V2 Components (Flash MX 2004 - Flash 8) (Moderators: vesa kortelainen, Ronald Wernecke, Jorge Solis, ..:: Mazhar Hasan ::.., papachan)
| | |-+  tree open close/nodes problem
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: tree open close/nodes problem  (Read 5740 times)
lambda
Server what's that
*
Posts: 13


View Profile
« 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
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« 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
Logged

lambda
Server what's that
*
Posts: 13


View Profile
« 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!]
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« 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
Logged

lambda
Server what's that
*
Posts: 13


View Profile
« 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!  Cry

thank you jorge, i'll let you know.
L
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything