1 Reply Latest reply on May 10, 2007 12:09 PM by Dr._Goomba

    Using arrayCollection.contains()

    Dr._Goomba Level 1
      This works: trace(genres2Movie.contains("91"));
      This doesn't: trace(genres2Movie.contains(genres .genreID));

      How can i use dynamic objects with this function? Thanks!
        • 1. Re: Using arrayCollection.contains()
          Dr._Goomba Level 1
          Seems i jumped the gun on this. It seems there is a problem with my genres2Movie arrayCollection in the way i populate it. I am populating by converting a string to an array as a new arrayCollection. But considering this is an arrayCollection, why i am having problems using functions available to the arrayCollection?

          var movieData:Object = new Object();
          movieData.genres = "Comedy,Drama, Action";
          // convert string to array collection
          var genres2Movie:ArrayCollection;
          genres2Movie = new ArrayCollection(this.movieData.genres.split(","));