Copy link to clipboard
Copied
I'm using the tree component from here: http://developer.yahoo.com/flash/astra-flash/tree/examples.html
I'm trying to figure out when a branch node has been expanded/collapsed. In the documentation I find the TreeEvent class with ITEM_OPEN and ITEM_CLOSE. (http://developer.yahoo.com/flash/astra-flash/classreference/)
Which would seem to be what I need.
I've got me tree setup with data, everything else is working. And I add the following:
import com.yahoo.astra.fl.events.TreeEvent;
mytree.addEventListener(TreeEvent.ITEM_OPEN, openBranch);
mytree.addEventListener(TreeEvent.ITEM_CLOSE, closeBranch);
function openBranch(e:TreeEvent) {
trace("Hello from openBranch");
}
function closeBranch(e:TreeEvent) {
trace("Hello from closeBranch");
}
Neither one is getting called. I've tried opening/closing by both the plus/minus and clicking on the entry. Nothing seems to work.
Anybody have experience with the tree component? Or with a different one that I could use?
Copy link to clipboard
Copied
Anybody. I'm still trying to get the item open/close events. I'm just not sure who/what might be dispatching them.
Copy link to clipboard
Copied
I downloaded the source code. It looks like the event is only dispatched if the branch is open/closed by using the keyboard! Whos idea was that?
Copy link to clipboard
Copied
It looks like they were moving the open/close behavior out of the Tree class and putting it into the BranchNode class.
So I've added a custom event dispatcher helper to that class. And it seems to be working, except of course that the event should be dispatched by the Tree and not by the Branch. Does anybody know how to make it seem that the event is dispatched by the Tree?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more