# Targeting a drop menu to load external swf's?

**URL:** https://forum.kirupa.com/t/targeting-a-drop-menu-to-load-external-swfs/296975
**Category:** flash
**Created:** [September 23, 2009, 4:24pm UTC](https://forum.kirupa.com/t/targeting-a-drop-menu-to-load-external-swfs/296975 "2009-09-23T16:24:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Raccoon](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Raccoon](https://forum.kirupa.com/u/Raccoon)
#### Post date: [September 23, 2009, 4:24pm UTC](https://forum.kirupa.com/t/targeting-a-drop-menu-to-load-external-swfs/296975/1 "2009-09-23T16:24:05Z")

</div>

Hello I’m trying to load external swf’s with a drop menu, this menu it’s a movie clip and I,m trying to controlling it with script out of the movie clip, the main button apparently works fine but the rest of the code fail. And i want to know how can i make a script for the sub menus.

Thanks for the help, can you tell me where can i find some references to do this or if somebody explain to me what I’m doing wrong I’ll appreciated.

Sample in the file…

Thanks for watching…

this is the script:

stop();

var myLoader:Loader; [COLOR=Red][COLOR=Red][COLOR=Red][COLOR=Red][COLOR=Red]//how can i target this variable to the dropMenu movie clip instance???[/COLOR][/COLOR][/COLOR][/COLOR][/COLOR]  
dropMenu.main.addEventListener(MouseEvent.CLICK, clickB);

function clickB(e:MouseEvent):void {  
trace(“click”)  
myLoader = new Loader();  
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, onLoaded);  
myLoader.load(new URLRequest(“B.swf”));  
}

dropMenu.subA.addEventListener(MouseEvent.CLICK, gotoframe); [COLOR=Red]// why this not work???[/COLOR]

function gotoframe(e:MouseEvent):void {  
trace(“click”)  
myLoader = new Loader();  
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, onLoaded);  
myLoader.load(new URLRequest(“B.swf”));  
gotoAndStop(“frame”);

}

function onLoaded(e:Event):void {  
container.removeChildAt(0);  
container.addChild(myLoader);

```
myLoader = null;

```

}
