all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

Troubles with Tree component.


Troubles with Tree component. Ensness
2/25/2006 8:45:15 PM
flash actionscript: Hi all!

I got some trouble with Tree component. I have a button on my stage named
MakeChild. That button makes currently selected node a child of the previous
sibling. The code is provided below.
The problem is that the result of the function are TWO new nodes that are
identical and one of them responces on click event of another. I suppose that
is a bug or something.

The code:

cmdMakeChild.onPress = function()
{
var node:XMLNode;
var subNode:XMLNode = trMenu.selectedNode.parentNode;
for(var i = 0; i < subNode.childNodes.length; i++)
{
if (subNode.childNodes == trMenu.selectedNode)
{
var delNode = subNode.removeTreeNodeAt(i);
node = subNode.childNodes.addTreeNode(delNode);
break;
}
}
if (node != undefined)
{
trMenu.setFirstVisibleNode(node);
trMenu.selectedNode = node;
}
}
Re: Troubles with Tree component. Ensness
2/27/2006 1:52:07 PM
AddThis Social Bookmark Button