0
votes

I want to customize the scrollbars on a mx|Tree component is Flex 4. I would like to mimic this functionality: http://flexponential.com/2009/10/09/changing-the-position-of-the-scroll-bars-in-a-spark-list/

Any thoughts or reccomendations?

2
This is going to be extremely hard w/ a mx component. I am not aware of a Spark Tree. - JeffryHouser
You should better look for a Spark List Component, it's more easy to skin, you can use a simple Scroller SkinClass. - papachan

2 Answers

0
votes

This can work, add your own error checking/styling, but you get the idea:

<s:VGroup gap="-1">
        <s:Button width="100%" label="Scroll up" click="{tree.verticalScrollPosition--}" />
        <mx:Tree id="tree" labelField="@label" showRoot="false" width="300" height="150"
                 verticalScrollPolicy="off">
            <mx:dataProvider>
                <fx:XML>
                    <root>
                        <node label="Parent 1">
                            <node label="Child 1" />
                            <node label="Child 2">
                                <node label="Grandchild 1" />
                                <node label="Grandchild 2" />
                            </node>
                            <node label="Child 3" />
                            <node label="Child 4" />
                            <node label="Child 5" />
                            <node label="Child 6" />
                            <node label="Child 7" />
                            <node label="Child 8" />
                            <node label="Child 9" />
                        </node>
                    </root>
                </fx:XML>
            </mx:dataProvider>
        </mx:Tree>
        <s:Button width="100%" label="Scroll Down" click="{tree.verticalScrollPosition++}"/>
    </s:VGroup>
0
votes

you could also try to use verticalScrollBarStyleName/horizontalScrollBarStyleName with a css style. But ofc it lacks the comfort of spark skins. ;)