0 Replies Latest reply on Sep 15, 2008 2:59 AM by luciewong

    Arrays within an Array

    luciewong Level 1
      Hi,
      how can I read a 2dimensional array.

      I have a main_array:
      var main_array:Array = Array();
      the main_array looks like: [x,x,x,x,x,x,x,x,x,x]

      I have a itemA_array, looks like: [A,AA,AAA]

      I have a itemB_array, looks like: [B,BB,BBB]

      I put the 2 arrays into the main_array:

      main_array.splice(2,1,itemA_array);
      main_array.splice(3,1,itemB_array);

      So far no problem. I load the main_array up with LV to the Database.
      It arrives correctly.
      The main_array is 10 elements,
      itemA is on [2]
      itemB is on [3]

      The problem:
      when I read the data in with LV like:

      var main_array:Array = Array();
      main_array = this.main_array;

      Flash cannot read, that the elements on [2] and [3] are arrays.
      Now my main_array has a length of 14 elements, it reads the As + Bs as single elements.
      How can I read the 2 item arrays??

      Thank you in advance.
      Luciewong