1 Reply Latest reply on Jun 29, 2007 9:57 AM by gammajack

    arrayCollection values to variables

    gammajack
      This is probably a trivial topic, but I am having problems taking values from an arrayCollection (acUsers, which I have confirmed functionality by using a dataGrid to display values) to variables (the variables will ultimately be contained in a class.as file, but for now, I am working with them in my primary document). The variables are defined higher up in the document and are functional.

      Sample Code:

      private function set_user():void{
      MyEmail = (acUsers[0]);
      MyId = (acUsers[1]);
      MyLevel = (acUsers[2]);
      MyDomain= (acUsers[3]);
      MyName = (acUsers[4]);
      MyPassword = (acUsers[5]);
      MyLastLogin = (acUsers[6]);
      MyLogin = (acUsers[7]);
      MyPrivs = (acUsers[8]);
      MyCompany = (acUsers[9]);
      }

      The results I get when writing the contents of the variables to labels is [Object Object]. What am I doing wrong?
        • 1. Re: arrayCollection values to variables
          gammajack Level 1
          Figured it out. The array is an associatve array, so it needed to be called as such:
          private function set_user():void{
          MyEmail = (acUsers["MyEmail"]);
          MyId = (acUsers["MyId"]);
          MyLevel = (acUsers["MyLevel"]);
          MyDomain= (acUsers["MyDomain"]);
          MyName = (acUsers["MyName"]);
          MyPassword = (acUsers["MyPassword"]);
          MyLastLogin = (acUsers["MyLastLogin"]);
          MyLogin = (acUsers["MyLogin"]);
          MyPrivs = (acUsers["MyPrivs"]);
          MyCompany = (acUsers["MyCompany"]);
          }