2 Replies Latest reply on Nov 4, 2008 5:05 AM by EvolvedDSM

    Referencing values in Array Collection?

      I'm using a Remote Object to pass an argument to a CFC. I then query a table according to the value of the argument passed in ('where' clause). I return a single record result as a query in Flex (event.result) and set it as an Array Collection, example:
      myAC = new ArrayCollection;
      myAC.source = event.result as Array;

      I can take this AC and set it as a dataprovider for a data grid or list without problem. What I'd like to do is pull specific data from the AC and use it in my Flex app. For example, the results of my query will return 1 record only, but contains many columns from my table. It might contain an ID, a username, a first and last name, maybe a phone number, etc. All this info for that single record will be stored in the array collection. What I want to do is be able to reference this data in Flex.

      For instance, if I need to display the phone number (stored as phoneNumber from my query) in the array collection, how can I do this? myAC.phoneNumber? myAC.getItemAt(0).phoneNumber?

      Any guidance is appreciated