I am using flex-4-tree (https://github.com/wasbridge/flex-4-tree)
in a mobile phone AIR app.
The Tree CLass:
public class Tree extends List
{
...
dataSource.addEventListener(TreeEvent.NODE_EXPANDED, nodeExpandedHandler);
dataSource.addEventListener(TreeEvent.NODE_COLLAPSED, nodeCollapsedHandler);
...
}
There is a menu on the main screen of the app.
If the user selects a menu-item, the appropriate action is taken,
but if the user expands/collapses a menu-item by selecting the expander icon,
the menu-item is expanded/collapsed.
Currently the List change Event is received before the
flex-4-tree Expand/Collapse Events.
I need to receive the flex-4-tree Expand/Collapse Events before
the List change Event.
Any help would be greatly appreciated.
Set up a timer in your handler for the ListChangeEvent that defers any action for a tenth of a second. Then if you expand/contract event comes in before the timer ends, you can cancel the action for the change event. Something like this:
Not the cleanest thing in the world, but should do the trick. Hope that helps!