Menu Creation with ActionScript - Need some help with adding actions

I’ve got a sample flash element that loads an xml file in order to build a menu. I would like to add actions to the flash element (i.e. click on a menu item and go to a particular url), and am unable to get this working properly. If anyone can help me, it would be greatly appreciated.

I’ve attached all of the source code in a zip file.

I’ll paste my actionscript below, which is broken across 2 layers. In addition, I have posted my xml input file below.

========layer 1, frame 1========
menuClass.prototype = new MovieClip();
function menuClass(){
this = _root.attachMovie(“menu”,“menu”,0);
this._visible = false;
this._data = new XML();
this._data._parent = this;
this._data.ignoreWhite = true;;
this._data.load(“menu.xml”);
this._data.onLoad = parseMenu;
this.init();
}

Object.registerClass(“menu”,menuClass);

parseMenu = function(){
nbChilds = this.firstChild.childNodes.length;
//for(var i=0;i<nbChilds+1;i++){
for(var i in this.firstChild.childNodes){
temp = new itemClass();
temp.init(i);
itemMc = temp.mc;
itemMc._y = 20i;
itemMc.park = 20
i;
itemMc.label = this.firstChild.childNodes*.attributes.label;

for(var j=0;j<this.firstChild.childNodes*.childNodes.length;j++){
itemMc.attachMovie(“sub”,“sub”+j,10j);
itemMc[“sub”+j]._y = 20 + 20
j;
itemMc[“sub”+j].toto = this.firstChild.childNodes*.childNodes[j].attributes.label;
}
itemMc.distance = j20;
}
var temp = new itemClass();
temp.init(this.firstChild.childNodes.length);
var itemMc = temp.mc;
itemMc._y = 20
this.firstChild.childNodes.length;
itemMc.park = 20*this.firstChild.childNodes.length;

this._parent._visible = true;
}

menuClass.prototype.init = function(){
this.attachMovie(“mask”,“mask”,300);
with(this.mask){
_y = -1
_height = _root.menu.item4._y;
_width = 101;
}

this.createEmptyMovieClip(“topEdge”,203);
with(this.topEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0,0);
lineTo(100,0);
}
this.setMask(this.mask)
}

menuClass.prototype.onEnterFrame = function(){

this.mask._height = this.item4._y+2;

this.createEmptyMovieClip(“leftEdge”,200);
with(this.leftEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0, 0 );
lineTo( 0,this.item4._y );
}

this.createEmptyMovieClip(“rightEdge”,201);
with(this.rightEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 100, 0 );
lineTo( 100,this.item4._y );
}

this.createEmptyMovieClip(“bottomEdge”,202);
with(this.bottomEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0,this.item4._y );
lineTo( 100, this.item4._y);
}
}

myMenu = new menuClass();

========Layer 2, Frame 1===========
this._lockroot = true;

itemClass.prototype = new MovieClip();
Object.registerClass(“item”,itemClass);

function itemClass(){
this.open = false;
itemOpen = undefined;
}

itemClass.prototype.init = function(i){
this.mc = _root.menu.attachMovie(“item”,“item”+i,10*i);
}

itemClass.prototype.onEnterFrame = function(){

if(this.quel() <= itemToOpen){
this.seek = this.park;
}else if(this.quel() > itemToOpen){
this.seek = this.park + distance;
}else{

}
this.goEase(this.seek,4);
}

itemClass.prototype.onRollOver = function(){

if(this.open){
itemToOpen = undefined;
itemToClose = this.quel();
}else{
itemToOpen = this.quel();
itemToClose = undefined;
}
distance = this.distance ;
}

itemClass.prototype.onRollOut = function(){
itemToOpen = Infinity;
}

itemClass.prototype.quel = function(){
return Number(this._name.slice(4));
}

itemClass.prototype.goEase = function(target,speed){
this._y = this._y + (target - this._y)/speed;
if(Math.abs(this._y-target) < 0.8)this._y = target;
}

===========dynamically loaded xml file contents========
<menu>
<menuItem label=“Home”>
</menuItem>
<menuItem label=“Message Board”>
</menuItem>
<menuItem label=“Miscellaneous”>
<sub label=“Slide Show” data=""/>
<sub label=“Animated Beta” data=""/>
<sub label=“Local Weather” data=""/>
</menuItem>
<menuItem label=“Reads”>
<sub label=“Articles” data=""/>
<sub label=“Interviews” data="" />
</menuItem>
</menu>