# Loader function in AS3

**URL:** <https://forum.kirupa.com/t/loader-function-in-as3/302399>\
**Category:** flash\
**Created:** [December 29, 2009, 5:11pm UTC](https://forum.kirupa.com/t/loader-function-in-as3/302399 "2009-12-29T17:11:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![almondo](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@almondo](https://forum.kirupa.com/u/almondo)\
**Post date:** [December 29, 2009, 5:11pm UTC](https://forum.kirupa.com/t/loader-function-in-as3/302399/1 "2009-12-29T17:11:34Z")

</div>

Hi…  
please help!!!  
OK so I’m learning AS3 and I’m trying to load 2 different swf files into seperate movie clips on the stage… but i can only get one to load… is there a special command to use, or am i doing something else wrong??.. after reading the help file says i can only have one addchild for a loader… can anyone help me write the code to get 2 swfs into 2 seperate movie clips??? Thank you all so much and Happy New Year…

Here’s the code i have so far;

```auto

var topMenuLocation:String = "../../../menus/topMenu.swf";
//var topMenuLocation:String = "root.menus/topMenu.swf";
var botMenuLocation:String = "../../../menus/bottomMenu.swf";
//var topMenuLocation:String = "root.menus/bottomMenu.swf";
var topMenuLoader:Loader;
var botMenuLoader:Loader;

loadTopMenu(topMenuLocation);
loadBotMenu(botMenuLocation);

function loadTopMenu(url:String):void 
{
    // Set properties on my Loader object
    topMenuLoader = new Loader();
    topMenuLoader.load(new URLRequest(url));
    topMenuHolder_mc.addChild(topMenuLoader);
}

function loadBotMenu(url:String):void 
{
    // Set properties on my Loader object
    botMenuLoader = new Loader();
    botMenuLoader.load(new URLRequest(url));
    botMenuHolder_mc.addChild(botMenuLoader);
}
stop();

```

Only one of the swfs (topMenu) loads up  
Thanks again so much
