Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Astra tree component

LEGEND ,
Aug 24, 2012 Aug 24, 2012

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?

TOPICS
ActionScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2012 Aug 28, 2012

Anybody. I'm still trying to get the item open/close events. I'm just not sure who/what might be dispatching them.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2012 Aug 28, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2012 Aug 28, 2012
LATEST

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines