Hello, I want to organize XML information into an array that can be accessed by
any function in the timeline. I also want to give the array an index ID
(unitID) so I can easily access the array's indexed elements by name, but for
some reason my array is not being defined outside the function. What is the
best way to assign an array global scope such as a variable?

//Timeline variable
var unitsArray:Array = new Array();

function loadFloorplans(selectedUnitSize) {
var nodeUnitSize:String;
var unitID:String;
var unitCount:Number;
var pdf:String;
var sqft:String;

for (var i:Number = 0; i<RootNode.childNodes.length; i++) {
nodeUnitSize = RootNode.childNodes[i].attributes.unitsize;
if (nodeUnitSize == selectedUnitSize) {
unitID = RootNode.childNodes[i].attributes.unit;
pdf = RootNode.childNodes[i].attributes.pdf;
sqft = RootNode.childNodes[i].attributes.sqft;
var unitdata = [unitID,pdf,sqft];
unitsArray.unitID = unitdata;