Skip navigation
Currently Being Moderated

Problem with Vector map() method

Jun 16, 2009 7:23 AM

I'm trying to map a Vector of Strings and assign the returning Vector to a variable, but the result from the map() is null...

If I use an Array instead of a Vector.<String> the problem disappears...

Here's the code:

private var validPhotoExtensions:Vector.<String> = Vector.<String>(["jPG", "jpeg"]);

 

var toLowerCase:Function = function(item:String, index:int, vector:Vector.<String>) : String
                                            {
                                                var str:String = String(item).toLowerCase();
                                                return str;
                                            };

 

var bla:Vector.<String> = new Vector.<String>();

// The value of bla will be nul...

bla = validPhotoExtensions.map(toLowerCase);

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points