2 Replies Latest reply on Jun 13, 2008 12:10 PM by stetzwebs

    Newbie to Flex...Arrays of Strings

    stetzwebs
      I have an XMLListCollection that is populated from a database that contains census data. Each entry is a person with a race, occupation, marital status, family size, and year. I want to make an array of either objects or strings (I don't really care, as long as it works) where each entry in the array is a unique field value. For instance, if my database contains people that have family sizes of 3, 4, 5, 4, 4, 3, 4, and 5, then I want my array to have 3 values, 3, 4, and 5. Right now, the code doesn't deal with duplicates, but once I have it so that it makes an array of strings of the values themselves I'll deal with the duplicates. The database is initially loaded into the stats XMLListCollection.

      To accomplish this, I have the attached code.

      The display is as follows: The first label outputs 27, which is correct since that's how many items I have to put in the array. The list is populated correctly, with all the years displaying as they should. The popupmenu is empty, which boggles my mind. And finally the length of the years array outputs as 0. I am very, very confused as to why any of this happens. Help, please.