arrays in Flash

Out of context: Reply #2

  • Started
  • Last post
  • 11 Responses
  • mrbee28280

    What I do is parse each node I need into an object with attributes. That gives me a 2D array that frees me of indexing like theArray[0][2] for something specific. With objects inside the array you can get anything like theArray[0].shirtSize etc.

    theArray = new Array();
    theShirt = new Object;

    // loop through xml
    theShirt.size = node.attribute;
    theShirt.color = node.attribute;

    theArray.push(theShirt)

    // end loop

View thread