User Guide

446 Client System Environment
}
capDP.sortOn("name", Array.CASEINSENSITIVE);
return capDP;
}
The getBrowserObjects() method returns an array of each of the propreties in the browser’s
navigator object. If this array has a length of one or more items, the array of browser
capabilities (
navArr) is appended to the arrray of Flash Player capabilities (capDP), and the
entire array is sorted alphabetically. Finally, the sorted array is returned to the main
application file, which then populates the data grid. The code for the
getBrowserObjects()
method is as follows:
private static function getBrowserObjects():Array
{
var itemArr:Array = new Array();
var itemVars:URLVariables;
if (ExternalInterface.available)
{
try
{
var tempStr:String = ExternalInterface.call("JS_getBrowserObjects");
itemVars = new URLVariables(tempStr);
for (var i:String in itemVars)
{
itemArr.push({name:i, value:itemVars[i]});
}
}
catch (error:SecurityError)
{
// ignore
}
}
return itemArr;
}
If the External API is available in the current user environment, Flash Player calls the
JavaScript
JS_getBrowserObjects() method, which loops over the browsers navigator
object and returns a string of URL-encoded values to ActionScript. This string is then
converted into a URLVariables object (
itemVars) and added to the itemArr array, which is
returned to the calling script.