2 Replies Latest reply on Oct 18, 2007 9:59 PM by MrKnives

    (Flash 8) Deleting undefined strings from an Array

    MrKnives Level 1
      i have it set to where it can lists the undefineds as null... but how do i remove them from the array completely so they dont show up at all?
      I want to filter out the data from the array... hopefully my question is clearer this time and I'm thankful for anybody that helps.. thanks..


      Data in text.txt
      quote:

      KaiOrbitalServer=220.110.159.220;

      KaiOrbitalServer=87.118.96.216;

      KaiOrbitalServer=221.240.208.210;

      KaiOrbitalServer=221.251.3.70;

      KaiOrbitalServer=221.115.88.55;

      KaiOrbitalServer=62.75.202.112;

      KaiOrbitalServer=88.198.48.232;

      KaiOrbitalServer=84.200.226.110;

      KaiOrbitalServer=91.121.77.194;

      KaiOrbitalServer=64.46.44.12;

      KaiOrbitalServer=166.70.145.104;

      KaiOrbitalServer=66.135.32.175;

      KaiOrbitalServer=65.208.243.13;

      KaiOrbitalServer=67.18.15.194;

      KaiDeepResolutionServer=41.23.53.83;

      KaiDeepResolutionServer=41.35.168.42;

      KaiDeepResolutionServer=41.20.232.129;

      KaiDeepResolutionServer=23.13.67.106;

      KaiVersion=Launch;7.1.7.6;

      KaiVersion=Engine;7.1.7.6;
        • 1. Re: (Flash 8) Deleting undefined strings from an Array
          clbeech Level 3
          you could use array.splice(i,0); to remove an element from the array at the index iterated to at the current value 'i'. use in the conditional, if ==null.

          I think that's what your looking for? :)
          • 2. Re: (Flash 8) Deleting undefined strings from an Array
            MrKnives Level 1
            I tried what you said and it just makes the last value repeat over and over again instead of undefined... do you know if i need/can to use something else besides a "for" loop to read the variables and put them in.. or maybe it has something to do with the "arr = k[1]" in the for loop...
            I don't know where I'm going wrong to be honest... this is the file that i'm working on if anybody can take a look at it and see where I'm going wrong...
            http://www.mediafire.com/?ao2byjegcm1
            I mean should i get rid of the for loop altogether or something?
            cause when i get rid of it it just repeats the last valid string over and over again
            like this:
            quote:

            220.110.159.220, 87.118.96.216, 221.240.208.210, 221.251.3.70, 221.115.88.55, 62.75.202.112, 88.198.48.232, 84.200.226.110, 91.121.77.194, 64.46.44.12, 66.70.145.104, 66.135.32.175, 65.208.243.13, 67.18.15.194, 67.18.15.194,67.18.15.194,67.18.15.194,67.18.15.194,67.18.15.194, 67.18.15.194,67.18.15.194, 67.18.15.194


            I got the same results with another formula... does anybody know where I'm going wrong? any help is appreciated.