XML Menu to Load External SWFs?

Right now, I’m building a new website from ground up using Actionscript 3. And this is the first time I’m using AS3. I read some previous posts about this, but I’m still confused and lost. Bear with me…

So currently, I have a XML menu. I followed the tutorial from here: http://tutorials.flashmymind.com/200…-menu-via-xml/. It needs more work and tweaking, but that’s for later. The menu.swf is from an external SWF and it’s loaded into my index.swf using the loader.

My question is how can I have the menu load different external SWFs, in other words, different part of the website. Do I create another loader in the index.swf for loading the website’s content? Can I use the existing XML file for the loading the SWFs?

Thank you so much for any help in advance.

Here are the codes I have so far:

Index.swf

[COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]display[/COLOR].*;
[COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]net[/COLOR].[COLOR=#000000]URLRequest[/COLOR];

[COLOR=#993300]var[/COLOR] menuldr:Loader = [COLOR=#993300]new[/COLOR] Loader[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] menuUrl:[COLOR=#993300]String[/COLOR] = [COLOR=#0000ff]"menu.swf"[/COLOR];
[COLOR=#993300]var[/COLOR] menuUrlReq:URLRequest = [COLOR=#993300]new[/COLOR] URLRequest[COLOR=#000000]([/COLOR]menuUrl[COLOR=#000000])[/COLOR];
menuldr.[COLOR=#993300]load[/COLOR][COLOR=#000000]([/COLOR]menuUrlReq[COLOR=#000000])[/COLOR];
menuldr.[COLOR=#000000]x[/COLOR] = [COLOR=#000000]25[/COLOR];
menuldr.[COLOR=#000000]y[/COLOR] = [COLOR=#000000]25[/COLOR];
addChild[COLOR=#000000]([/COLOR]menuldr[COLOR=#000000])[/COLOR];

[COLOR=#f000f0]*/*
var contentldr:Loader = new Loader();
var aboutUrl:String = "about.swf";
var servicesUrl:String = "services.swf";
var contactUrl:String = "contact.swf";
var contentUrlReq:URLRequest = new URLRequest(aboutUrl);
contentldr.load(contentUrlReq);
contentldr.x = 250;
contentldr.y = 25;
addChild(contentldr);
*/*[/COLOR]

Menu.swf

[COLOR=#993300]import[/COLOR] fl.[COLOR=#000000]transitions[/COLOR].[COLOR=#000000]Tween[/COLOR];
[COLOR=#993300]import[/COLOR] fl.[COLOR=#000000]transitions[/COLOR].[COLOR=#000000]easing[/COLOR].*;

[COLOR=#993300]var[/COLOR] xmlPath:[COLOR=#993300]String[/COLOR] = [COLOR=#0000ff]"menu.xml"[/COLOR];
[COLOR=#993300]var[/COLOR] settingsXML:[COLOR=#993300]XML[/COLOR];
[COLOR=#993300]var[/COLOR] tweensArray:[COLOR=#993300]Array[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Array[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] buttonTween:Tween;

[COLOR=#993300]var[/COLOR] loader = [COLOR=#993300]new[/COLOR] URLLoader[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
loader.[COLOR=#993300]load[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#993300]new[/COLOR] URLRequest[COLOR=#000000]([/COLOR]xmlPath[COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
loader.[COLOR=#000000]addEventListener[/COLOR] [COLOR=#000000]([/COLOR]Event.[COLOR=#000000]COMPLETE[/COLOR], xmlLoaded[COLOR=#000000])[/COLOR];

[COLOR=#993300]function[/COLOR] xmlLoaded [COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR]:Event[COLOR=#000000])[/COLOR]:[COLOR=#993300]void[/COLOR] [COLOR=#000000]{[/COLOR]

    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR].[COLOR=#993300]target[/COLOR] as URLLoader[COLOR=#000000])[/COLOR] != [COLOR=#993300]null[/COLOR] [COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        settingsXML = [COLOR=#993300]new[/COLOR] [COLOR=#993300]XML[/COLOR][COLOR=#000000]([/COLOR]loader.[COLOR=#993300]data[/COLOR][COLOR=#000000])[/COLOR];
        settingsXML.[COLOR=#000000]ignoreWhitespace[/COLOR] = [COLOR=#993300]true[/COLOR];
        createMenu [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    
[COLOR=#000000]}[/COLOR]
    
[COLOR=#993300]function[/COLOR] createMenu [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#993300]void[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]var[/COLOR] menuItem:MenuItem;
    [COLOR=#993300]var[/COLOR] i:uint = [COLOR=#000000]0[/COLOR];
    [COLOR=#993300]var[/COLOR] orgAlpha:[COLOR=#993300]Number[/COLOR] = [COLOR=#000000]0[/COLOR].[COLOR=#000000]5[/COLOR];
    [COLOR=#993300]var[/COLOR] newAlpha:[COLOR=#993300]Number[/COLOR] = [COLOR=#000000]1[/COLOR];
    [COLOR=#993300]for[/COLOR] each [COLOR=#000000]([/COLOR][COLOR=#993300]var[/COLOR] link:[COLOR=#993300]XML[/COLOR] [COLOR=#993300]in[/COLOR] settingsXML.[COLOR=#000000]links[/COLOR].[COLOR=#000000]link[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        menuItem = [COLOR=#993300]new[/COLOR] MenuItem[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
        menuItem.[COLOR=#000000]menuLabel[/COLOR].[COLOR=#993300]text[/COLOR] = link.@[COLOR=#993300]name[/COLOR];
        menuItem.[COLOR=#000000]menuLabel[/COLOR].[COLOR=#993300]autoSize[/COLOR] = TextFieldAutoSize.[COLOR=#993300]LEFT[/COLOR];
        menuItem.[COLOR=#000000]x[/COLOR] = [COLOR=#000000]0[/COLOR];
        menuItem.[COLOR=#000000]y[/COLOR] = [COLOR=#000000]0[/COLOR] + i*[COLOR=#000000]30[/COLOR];
        menuItem.[COLOR=#000000]alpha[/COLOR] = [COLOR=#000000]0[/COLOR].[COLOR=#000000]5[/COLOR];
        menuItem.[COLOR=#000000]buttonMode[/COLOR] = [COLOR=#993300]true[/COLOR];
        menuItem.[COLOR=#000000]mouseChildren[/COLOR] = [COLOR=#993300]false[/COLOR];
        menuItem.[COLOR=#000000]addEventListener[/COLOR] [COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000000]MOUSE_OVER[/COLOR], mouseOverHandler[COLOR=#000000])[/COLOR];
        menuItem.[COLOR=#000000]addEventListener[/COLOR] [COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000000]MOUSE_OUT[/COLOR], mouseOutHandler[COLOR=#000000])[/COLOR];
        addChild [COLOR=#000000]([/COLOR]menuItem[COLOR=#000000])[/COLOR];
        i++;
    [COLOR=#000000]}[/COLOR]

[COLOR=#993300]function[/COLOR] mouseOverHandler [COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR]:Event[COLOR=#000000])[/COLOR]:[COLOR=#993300]void[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*/*e.target.alpha = 1, Regular.easeIn;*/*[/COLOR]
    buttonTween = [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR].[COLOR=#993300]target[/COLOR], [COLOR=#0000ff]"alpha"[/COLOR], Regular.[COLOR=#000000]easeOut[/COLOR], orgAlpha, newAlpha, [COLOR=#000000]0[/COLOR].[COLOR=#000000]75[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    
[COLOR=#993300]function[/COLOR] mouseOutHandler [COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR]:Event[COLOR=#000000])[/COLOR]:[COLOR=#993300]void[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*/*e.target.alpha = 0.75;*/*[/COLOR]
    buttonTween = [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR][COLOR=#993300]e[/COLOR].[COLOR=#993300]target[/COLOR], [COLOR=#0000ff]"alpha"[/COLOR], Regular.[COLOR=#000000]easeOut[/COLOR], newAlpha, orgAlpha, [COLOR=#000000]0[/COLOR].[COLOR=#000000]75[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]

XML File

<?xml version="1.0" encoding="utf-8"?>

<menu>
    
    <links>
        <link name="ABOUT" />
        <link name="SERVICES" />
        <link name="CONTACT" />
    </links>
        
</menu