1 Reply Latest reply on Oct 25, 2007 4:28 AM by AScracker

    Need Help in Array

    AScracker
      hi
      i am using the array like [1,2,2,2,3,3,3,4,5,6,7,7,7]

      but it need to display the array like [1,2,3,4,5,6,7] when i called

      can any one give idea for this issue.......
      ~~Sk
        • 1. Re: Need Help in Array
          AScracker Level 1
          hi
          i got the answer to solve this issue....

          var myArray:Array = ["apple", "orange", "orange", "orange", "apple", "pear"];
          tempArray = new Array();
          tempIndex = 0;
          myArray.sort();
          tempArray[0] = myArray[0];
          tempIndex++;
          for (var i = 1; i<myArray.length; i++) {
          if (myArray != myArray[i-1]) {
          tempArray[tempIndex] = myArray
          ;
          tempIndex++;
          }
          }
          myArray = tempArray;
          trace(myArray.join());


          ~~Sk