findLocation( map : Map, nFinder : int, fields : String[]) : FoundLocation[]
Finds location(s) by the specified parameters.

Parameters:
map - Map object
nFinder - the number of a given finder
fields - string array

For the USA map you can use the following constants:
ADDRESS = 0
INTERSECTION = 1
ZIP = 2
CITY = 3
COUNTY = 4
AREACODE = 5
COORDINATES = 6

Additional parameters depend on the amount and order of the fields of the specified finder. For example, the ADDRESS finder has the following fields (the order of the fields is important): 'Address', 'ZIP', 'City', 'State'. Therefore, if you want to find an address you must use the following syntax:
var fields : String[] = ["380 New York St", "92373", "Redlands", "CA"];
var locs : FoundLocation[] = findLocation( map, CITY, fields);
or
var locs : FoundLocation[] = findLocation( map, CITY, ["380 New York St", "92373", "Redlands", "CA"]);

Note that you can omit the city and state fields you don't want to enter them (or use city and state, if you do not have the ZIP Code):
var fields : String[] = ["380 New York St", "92373"];
var fields : String[] = ["380 New York St", "92373", "", ""];

Other examples:
var fields : String[] = ["Redlands", "CA"];
var locs : FoundLocation[] = findLocation( map, CITY, fields);
var fields : String[] = ["Redlands"];
var locs : FoundLocation[] = findLocation( map, CITY, fields); (results equal Redlands, CA and Redlands, CO)
var fields : String[] = ["Orange", "CA"];
var locs : FoundLocation[] = findLocation( map, COUNTY, fields);
var fields : String[] = ["New York St", "W Park Ave", "", "Redlands", "CA"];
var locs : FoundLocation[] = findLocation( map, INTERSECTION, fields);

Returns:
An array of the FoundLocation objects, or null if the location is not found (see the FoundLocation object)

// Finders (USA map)
public const ADDRESS : int = 0;
public const INTERSECTION : int = 1;
public const ZIP : int = 2;
public const CITY : int = 3;
public const COUNTY : int = 4;
public const AREACODE : int = 5;
public const COORDINATES : int = 6;

// Finders (North American map)
public const NA_US_ADDRESS : int = 0;
public const NA_CA_ADDRESS : int = 1;
public const NA_US_INTERSECTION : int = 2;
public const NA_CA_INTERSECTION : int = 3;
public const NA_US_ZIP : int = 4;
public const NA_US_ZIP3 : int = 5;
public const NA_CA_POSTALCODE : int = 6;
public const NA_US_CITY : int = 7;
public const NA_CA_CITY : int = 8;
public const NA_US_COUNTY : int = 9;
public const NA_AREACODE : int = 10;
public const NA_COORDINATES : int = 11;


public function findLocation( map : Map, nFinder : int, fields : String[]) : FoundLocation[]
{
	
    if( fields.length < 1)
        return( null);
		
    var finders : FinderList = map.getFinders();
    var finder : Finder = finders.getFinder( nFinder);
	var fValue : String;
    
    for(var i : int = 0; i < finder.getFieldCount(); i++)
    { 
        fValue = i >= fields.length ? "" : fields[i];
        finder.setFieldValue(i, fValue);
    }
	
    var rs : Recordset = finder.find();

    if( isRSEmpty( rs)) return( null);
	
    var Locations : FoundLocation[] = new FoundLocation[rs.getRecordsCount()];
    
    var j : int = 0; rs.moveFirst();
	
    do
    {
        Locations[j++]=new FoundLocation(
                    rs.getAsIntByName("SCORE"),
                    rs.getAsStringByName( "NAME"),
                    rs.getAsDoubleByName( "X"),
                    rs.getAsDoubleByName( "Y"),
                    rs.getAsDoubleByName( "LAT"),
                    rs.getAsDoubleByName( "LONG")
                    );
    }
    while( rs.moveNext());

    return Locations;
}


public function isRSEmpty( rs : Recordset) : boolean
{
    return( rs == null || rs.getRecordsCount() == 0);
}


public class FoundLocation
{
    public var x : double;
    public var y : double;
    public var lat : double;
    public var lon : double;
    public var label : String ;
    public var score : int;

    public function FoundLocation(score : int, label : String, x : double, y : double, lat : double, lon : double)
    {
        this.score = score;
        this.label = label;
        this.x = x;
        this.y = y;
        this.lat = lat;
        this.lon = lon;
    }
}