[flexcoders] Re: spark ButtonBar selectedIndex out of view
Thanks. I haven't played with the Scroller so I will try it out (but a quick initial test gives a compile error ...a Scroller cant have a ButtonBar assigned to the default viewport property) I will probably go with Haykel's suggestion for now. thanks guys --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Maybe put the ButtonBar in a Scroller or put a Scroller in the ButtonBar skin? On 5/11/10 1:14 AM, bhaq1972 mbha...@... wrote: I have a spark ButtonBar with a horizontalLayout. The width of the ButtonBar is small ...so the end buttons don't show. When I set the selectedIndex to one of the end buttons...its not coming into view. How can I ensure the selectedItem is in view? thanks s:HGroup s:ButtonBar id=buttonbar1 width=500 requireSelection=true s:layout s:HorizontalLayout / /s:layout s:dataProvider s:ArrayCollection source=['Button1', 'Button2', 'Button3', 'Button4', 'Button5', 'Button6', 'Button7', 'Button8'] / /s:dataProvider /s:ButtonBar s:TextInput id=t1 text=7/ s:Button label=selectIndex click=buttonbar1.selectedIndex = Number(t1.text)/ /s:HGroup -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: spark ButtonBar selectedIndex out of view
Thanks. --- In flexcoders@yahoogroups.com, Haykel BEN JEMIA hayke...@... wrote: You can use the getScrollPositionDeltaToElement() function of the layout and add the x value of the returned point to the horizontalScrollPosition. Basically something like this (not tested): buttonbar1.layout.horizontalScrollPosition += buttonbar1.layout.getScrollPositionDeltaToElement(buttonbar1.selectedIndex).x; Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Tue, May 11, 2010 at 9:14 AM, bhaq1972 mbha...@... wrote: I have a spark ButtonBar with a horizontalLayout. The width of the ButtonBar is small ...so the end buttons don't show. When I set the selectedIndex to one of the end buttons...its not coming into view. How can I ensure the selectedItem is in view? thanks s:HGroup s:ButtonBar id=buttonbar1 width=500 requireSelection=true s:layout s:HorizontalLayout / /s:layout s:dataProvider s:ArrayCollection source=['Button1', 'Button2', 'Button3', 'Button4', 'Button5', 'Button6', 'Button7', 'Button8'] / /s:dataProvider /s:ButtonBar s:TextInput id=t1 text=7/ s:Button label=selectIndex click=buttonbar1.selectedIndex = Number(t1.text)/ /s:HGroup