Skip navigation
Currently Being Moderated

Spinner list data

Feb 21, 2013 5:41 PM

When I choose a item in the spinner list, where are this data stored?

 

 

 

<s:SpinnerListContainer x="173" y="72" width="133" height="109">

              <s:SpinnerList width="118" height="100%" labelField="data" selectedIndex="1">

                     <s:ArrayList>

                           <fx:Object data="Test 1"></fx:Object>

                           <fx:Object data="Test 2"></fx:Object>

                           <fx:Object data="Test 3"></fx:Object>

                           <fx:Object data="Test 4"></fx:Object>

                     </s:ArrayList>

              </s:SpinnerList>

</s:SpinnerListContainer>

 
Replies
  • Currently Being Moderated
    Feb 22, 2013 5:55 AM   in reply to fsoender

    In your example, in the spinner itself.

     

    Here is the example from the documentation.

    <s:SpinnerList id="spinner3" typicalItem="XXX" wrapElements="false"

                               fontWeight="bold" textAlign="center"

                               change="handleSelectionChange(event)">

                    <s:dataProvider>

                        <s:ArrayList>

                            <fx:String>AM</fx:String>

                            <fx:String>PM</fx:String>

                        </s:ArrayList>

                    </s:dataProvider>

    </s:SpinnerList>

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 4, 2013 8:43 AM   in reply to fsoender

    From what I think you are asking is, how do you get the selected item in order to do an action based on that selection.

     

     

    var selectedValue:String = ToolSpinnerLeft.value;
    

     

    Of course, to make things a litte easier for you, you coud change the Spinner list times to numeric

      <s:ArrayList>  
         <fx:Number>1</fx:Number>
         <fx:Number>2</fx:Number>
         <fx:Number>3</fx:Number>
         <fx:Number>4</fx:Number>
         <fx:Number>5</fx:Number>
       </s:ArrayList>
    

     

    Or, more simply, just have a minimum and maximum for your SpinnerList by using a NumericDataProvider

     

    <s:SpinnerList typicalItem="100">
        <s:dataProvider>
            <s:NumericDataProvider minimum="1" maximum="5" stepSize="1"/>
        </s:dataProvider>
    </s:SpinnerList>
    

    Then when you get the ToolSpinnerLeft.value; it will already be a number for the Switch example I gave in your other post.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points