1 Reply Latest reply on Nov 21, 2008 9:39 AM by Rothrock

    how to remove key from an array?

    Level 7
      I've googled "actionscript remove array key" for hours with no success.

      I am simply trying to remove a key from an array that is built as follow:

      images = new Array();
      images[0] = 'img1.jpg';
      images[1] = 'img2.jpg';
      images[2] = 'img3.jpg';

      How do I completely remove images[1] from the array?
      I mean remove the key, not just its value, so that images[2] becomes images[1].

      that should be very simple, yet coudn;t find one simple example anywhere...

      please help!

      --
      seb (@webtrans1.com)

      high-end web design: http://webtrans1.com
        • 1. Re: how to remove key from an array?
          Rothrock Level 5
          Well the best thing to do would be to read the help files for the array class. Everything you can do with an array is there. So instead of googling for hours spend 20 minutes and read that. I would recommend reading them in reverse alphabetic order since the one you want is splice().

          I believe splice is a fairly time consuming action so if you need to do a lot of it there might be better data structures for you.