PDA

View Full Version : itemRollOver tree component


jakepeg
11-28-2005, 09:53 AM
I want to use itemRollOver on the tree component but it just returns undefined on the following function . . . . . .


myTreeListener.itemRollOver = function(eventObject)
{
trace(eventObject.node.attributes.label+ " rollded over");
}
categories_tr.addEventListener("itemRollOver", myTreeListener);


yet this works


myTreeListener.nodeOpen = function(eventObject)
{
trace(eventObject.node.attributes.label+ " node Open");
}
categories_tr.addEventListener("nodeOpen", myTreeListener);

jakepeg
11-29-2005, 10:31 AM
I have discovered that I can use


trace(eventObject.index);


which returns the index of the node.

maybe it is possible to associate the index with the label attribute? but not sure how...

FormerSwinger
11-29-2005, 12:27 PM
try something like tree.getNodetAt(index);
the eventobject may also have some additional properties like target?

jakepeg
11-29-2005, 02:30 PM
thanks for the help.

used getNodeDisplayedAt()


function itemHandler1(obj:Object, item:ContextMenuItem) {
thisNode = tree.getNodeDisplayedAt(nodeRolledOver);
trace("node rolled over was "+thisNode.attributes.label);
}