Click here to Skip to main content
11,641,708 members (63,795 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android Flash Builder
Hello friends,

I am using SpinnerList in my applicaiton and by default it has a vertical layout. But I have a requirement of Horizontal SpinnerList.

I tried rotation but that was not enough.

    <s:titleContent>
       <s:SpinnerListContainer direction="ltr"  autoLayout="true">
           <s:SpinnerList id="titleSpinner" textAlign="center" >
               <s:ArrayList>
                  <fx:String>First</fx:String>
                  <fx:String>Second</fx:String>
                  <fx:String>Third</fx:String>
                  <fx:String>Fourth</fx:String>
                  <fx:String>Fifth</fx:String>
               </s:ArrayList>
           </s:SpinnerList>
       </s:SpinnerListContainer>
     </s:titleContent>

Please guide me
Posted 25-May-12 21:28pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello I found the solution. There no horizontal Spinner List. Therefore need to make a control.

<s:Scroller id="scrllr"
                    focusEnabled="false"
                    hasFocusableChildren="true"
                    width="100%">
            <s:HGroup id="hg" gap="20"
                      paddingTop="5" paddingRight="5" paddingBottom="5" paddingLeft="5">
                <s:Label text="First" color="White"
                     focusIn="textinput_focusInHandler(event)"/>
                <s:Label text="Second" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Third" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Fourth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Fifth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
                <s:Label text="Sixth" color="White"
                     focusIn="textinput_focusInHandler(event)" />
            </s:HGroup>
        </s:Scroller>


protected function textinput_focusInHandler(evt:FocusEvent):void
            {
                var idx:int = hg.getElementIndex(evt.target as IVisualElement);
                var lay:HorizontalLayout =  hg.layout as HorizontalLayout;
                if(lay.fractionOfElementInView(idx)<1)
                {
                    lay.horizontalScrollPosition +=lay.getScrollPositionDeltaToElement(idx).y;
                }
            }
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 233
1 Mika Wendelius 150
2 Sergey Alexandrovich Kryukov 134
3 OriginalGriff 110
4 Afzaal Ahmad Zeeshan 89
0 Mika Wendelius 460
1 OriginalGriff 265
2 DamithSL 258
3 CPallini 169
4 Afzaal Ahmad Zeeshan 149


Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100