2 Replies Latest reply on Nov 6, 2011 8:22 AM by kokorito

    Array collections.  Performing actions against it.

    xandout

      OK I am still fighting with a log in system in flex. 

       

      I have been able to populate my datagrid with service.lastresult which is an ArrayCollection.

       

      I am executing a statement like this SELECT username,password,role FROM users WHERE username = {userInput.text}

       

      My datagrid (for testing only) is showing all of that info.

       

      I would like to be able to perform some conditional statement against service.lastresult like

       

      if (passwordInput.text == service.lastresult.password){

      //Then go to the next state based upon the role field returned from MySQL

      }else{

      mx.controls.Alert.show("Incorrect login info");

      }

       

      The problem is that I do not have a clue how to access the data in my ArrayCollection (service.lastresult).

       

      I have read the Adobe docs on AC's and am still lost.  Most of the info I have found on the GOOGLE is just using an AC created in MXML like this

       

               <mx:ArrayCollection id="computersCollection">

                           <mx:Object label="Dell Mini 9 Netbook"/>

                           <mx:Object label="Dell Inspiron 546 Desktop"/>

                           <mx:Object label="Dell Inspiron 14 Laptop"/>

                           <mx:Object label="Alienware Aurora Desktop"/>

                           <mx:Object label="Alienware M17 Laptop"/>

                           <mx:Object label="HP Pavillon p6100 Desktop"/>

                           <mx:Object label="Compaq Presario CQ60Z Laptop"/>

                           <mx:Object label="Toshiba Teca M10 Laptop"/>

               </mx:ArrayCollection> http://www.devshed.com/c/a/XML/Flex-Array-Collection-Sort-and-Filtering/

       

      Any pointers even if only to the correct query for google are greatly appreciated.