1 Reply Latest reply on Apr 16, 2007 9:32 AM by parallaxed

    ArrayCollection As A dataProvider

    AwesomeDigital3 Level 1
      I am loading an external XML file into an ArrayCollection, then Binding a comboBox to that


      <mx:ComboBox rowCount="30" id="bookOfTheBible" dataProvider="{bibleBooks}" labelField="BookName" />

      The combo box fills fine with the BookName, but when an item is selected, I would like to retreive the book number from the ArrayCollection.

      Is that possible? I have been looking through the help but I have not yet found a way.


        • 1. Re: ArrayCollection As A dataProvider
          parallaxed Level 1
          ArrayCollections created from XML will be collections of Object instances. Object is a dynamic type, so the names of your elements will be added (at runtime) to the Object instance.

          You can access them like any other object property... i.e.

          <mx:Label text="BookNumber: {bookOfTheBible.selectedItem.BookNumber}" />
          - or -
          <mx:Label text="BookNumber: {bookOfTheBible.selectedItem.['BookNumber']" />