#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Burlington, VT
    Posts
    344
    Rep Power
    14

    Flash MX - Arrays


    Hello,

    I was wondering if Flash MX's array object could handle multi-dimensional associative arrays similar to:

    Array[0]['ID'] = 1;
    Array[0]['Name'] = "test 1";
    Array[1]['ID'] = 2;
    Array[1]['Name'] = "another test";
    etc...

    If so, how do I set it up?

    Thanks,
    -jbuckle24
    ------------------------------------------------------------
  2. #2
  3. No Profile Picture
    flashing vampire
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    nowhere
    Posts
    19
    Rep Power
    0

    Sure~


    Even flash 5 could handle with muti-dementional arrays.

    for example:
    PHP Code:
    myArr=[[1,2,3],[4,5,6]; 
    And please be aware that arrays recognize index not names.
  4. #3
  5. No Profile Picture
    Certified Genius
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    over there
    Posts
    77
    Rep Power
    14

    here ya go...


    you can mix associative and regular arrays...it can be coded a billion different ways...for instance:

    team = new Array();
    player = new Array();
    team[0] = new Array();
    team[0].name = "Cantona";
    team[1] = new Array();
    team[1].number = 9;

    trace(team[0].name);
    trace(team[1].number);

    would output...
    Cantona
    9

    ...and if all else fails hit F1 : ) ...Rob

IMN logo majestic logo threadwatch logo seochat tools logo