Trying to transfer an Array

hey currently in flash im opening up a file then i have a ufnction that turns part of that file into an arra, anyways with this fucntion that creates the array i want to transmit all th data thatsin the array to an outside source sorta liek this:

myArrayVariable = my ArrayFunction();

so here my ArrayFunction would compiel the array and then hand it off to myArrayVariable.

if anyone is intereted this is the cod ei have so far:

 
 
function loadMap(mapDir:String) {
 var mapDataArr:Array = new Array();
 IFVmapData = new LoadVars();
 IFVmapData.load("Maps/"+mapDir);
 IFVmapData.onLoad = function(success)
 {
  if(success)
  {
   mapDataArr["base"] = IFVmapData.baseMapData.split("[~]");
   for(var IFVa = 0 ; IFVa < mapDataArr["base"].length ; ++IFVa)
   {
    mapDataArr["base"][IFVa] = mapDataArr["base"][IFVa].split("[]");
    for(var IFVb = 0 ; IFVb < mapDataArr["base"][IFVa].length ; ++IFVb)
    {
     mapDataArr["base"][IFVa][IFVb] = mapDataArr["base"][IFVa][IFVb].split(",");
     //trace(IFVa+":"+IFVb+"[::]"+mapDataArr["base"][IFVa][IFVb][0])
    }
   }
   return mapDataArr["base"];
  }
  else
  {
   trace("could not Load The Map");
  }
 }
 return mapDataArr;
}
var mapData:Array = new Array();
mapData = loadMap("map001.php");
trace(mapData[0]);

[SIZE=1](the code is kinda messy cuz ive been messing aroudn with it so much)[/SIZE]
all that happens when i trace mapData[0] is it says “undefined”

any help woul dbe appreciated.