3 Replies Latest reply on Nov 28, 2011 1:40 PM by __gravija__

    Flex: how to select each element/instance of a repeater

    __gravija__

      I'll explain my problem as brief as possible. I have a variable bandName, the value is String that i get through an API.

       

       

       

       

       

      public function haalNaam(selectedChart:Object):String

      {

      var bandName:String = selectedChart.name;

      }

       

       

       

      I use this var in a repeater for a label. This repeater repeats 5 times, so it shows the 5 most hyped artists:

       

       

       

      <repeater>

      <label text="{haalNaam(lastfmCollection.currentItem)}"/>

      </repeater>

       

       

       

      Next, i had to transport the var bandName to another component. I managed to do this with this command:

       

      var theName = "LastFmApi(this.parentApplication).bandName"

      This code works, but I only manage to get the bandName of the last element in the repeater (5th one). I have no idea how i can receive the names of the artists 1,2,3 or 4. How can i get to those values?