8 Replies Latest reply on Dec 16, 2008 11:12 PM by kglad

    Displaying a Partial List Array?

    shintashi Level 1
      Hi, I'm trying to figure out how to take an existing array of elements (for sake of argument, earth, air, fire, water), and have a text display list as the base, +/- based on button behavior.

      So, for example, if I begin with earth, air

      and click the add button, it will switch to "earth, air, fire"
      if I click the add button again, it will display the four elements "earth, air,fire, water", and if I click the subtract button, it will subtract from the list (earth, air, fire... earth, air.... earth... undefined).

      The idea is to be able to go from a completely empty list (undefined) to completely full (such as four elements) and back, in increments of one. String(aElements.pop()); works fine for removing elements from the list, but
      aElements.push("___"); is completely insufficient for the task.