views:

108

answers:

2

How can you find out if a Flex Component (in my case the tree) is scrollable? I tried it like this

if (_listOwner.height < _listOwner.measuredHeight) {
  // so stuff
}

from within the tree's item renderer but didn't succeed. Access to the tree's scrollbar is private so that I can't get the info that way.

A: 

Found a solution by extending the tree class:

public class ExtendedTree extends Tree
{
    public function ExtendedTree()
    {
        super();
    }

    public function get isVerticalScrollable():Boolean
    {
        if (super.verticalScrollBar == null || super.verticalScrollBar.visible == false)
            return false;
        return true;
    }
}
Thomas
A: 

Use the maxVerticalScrollPosition and maxHorizontalScrollPosition properties.

Sam