A qouestion about procedure

I have this code for setting up my navigation. It works absolutely fine like it is, but I want to be able to change my arrays from OUTSIDE flash. Is it possible for me with this code to make it with XML or is it built in a way that makes that hard? I’m not an expert but think this is a good way for me to understand the whole deal with XML and arrays and such. What do you say, is it worth the while to try to implement XML and can someone just get me started on this? Thanks.


// Height of Mainmenu items
var homm:Number = 20;
// Height of Submenu items
var hosm:Number = 20;
// Speed of menu
var speed:Number = 0.8;
// Easing
var ease:String = "easeOutBack";

// MAIN MENU ARRAY
var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"];

// SUB MENU ARRAY
var sm1_array:Array = ["sub1", "sub2"];
var sm2_array:Array = ["sub1", "sub2", "sub3"];
var sm3_array:Array = ["sub1", "sub2", "sub3"];
var sm4_array:Array = ["sub1", "sub2", "sub3", "sub4"];

var submenu_array:Array = [];

// FUNCTIONS
_global.$tweenManager.broadcastEvents = true;
// Main menu
function createMainMenu() {
	var a = 1;
	var total = mm_array.length;
	while (a<=total) {
		ypos = ((a-1)*homm)+1;
		attachMovie("mainnav_mc", "mainnav"+a+"_mc", this.getNextHighestDepth()+100, {_x:0, _y:ypos});	// attach the movieClip
		var nc = this["mainnav"+a+"_mc"];
		nc.menutext = mm_array[(a-1)];	// set the title text for each button
		nc.itemnum = a;	// set the menu #
		a++;
	}
}
function moveMenu(num) {
	if ((_root.collapsed == true) || (_root.selectedmenu != num)) {
		var array = "sm"+num+"_array";
		var totalsm = eval(array).length;
		var totalmm = mm_array.length;
		var a = 1;
		while (a<=totalmm) {
			mc = this["mainnav"+a+"_mc"];
			if (a>num) {
				var ypos = (((a-1)*homm)+1)+totalsm*(hosm+1);
				mc.tween("_y", ypos, speed, ease); 
			} else {
				var ypos = ((a-1)*homm)+1;
				if (a == num) {
					nypos = ypos;
					mc.tween("_y", ypos, speed, ease, 0, onEnd(num, nypos));
				} else {
					mc.tween("_y", ypos, speed, ease);
				}
			}
			a++;
		}
		_root.collapsed = false;
	} else {
		contractMenu()
		_root.collapsed = true;
	}
}

function onEnd(num, nypos) {
	_root.num = num;
	createSubMenu(num, nypos);
}
function contractMenu() {
	var c = 1;
	while (c<=submenu_array.length) {
		removeMovieClip("subnav"+c+"_mc");
		c++;
	}
	var g = 1;
	while (g<=mm_array.length) {
		ypos = ((g-1)*homm)+1;
		this["mainnav"+g+"_mc"].tween("_y", ypos, speed, ease);
		g++;
	}
}
function createSubMenu(num, nypos) {
    var array = "sm"+num+"_array";
    var totalsm = eval(array).length;
    var ypos = nypos+4;
    var c = 1;
    while (c<=submenu_array.length) {
        removeMovieClip("subnav"+c+"_mc");
        c++;
    }
    submenu_array = [];
    var a = 1;
    while (a<=totalsm) {
        ypos = ypos+hosm+1;
        attachMovie("subnav_mc", "subnav"+a+"_mc", a+30, {_x:0, _y:ypos});
        nc = this["subnav"+a+"_mc"];
        nc._alpha = 0;
        nc.itemnum = a;
        nc.menutext = eval(array)[(a-1)];
        nc.alphaTo(100, 2);
        submenu_array.push("subnav"+a+"_mc");
        a++;
		}
}

// BUILD MENU
_root.collapsed = true;
createMainMenu();