# Deadline today swf with mutliple buttons to load child swfs that I can't get to work

**URL:** <https://forum.kirupa.com/t/deadline-today-swf-with-mutliple-buttons-to-load-child-swfs-that-i-cant-get-to-work/285034>\
**Category:** Uncategorized\
**Created:** [March 26, 2009, 11:17am UTC](https://forum.kirupa.com/t/deadline-today-swf-with-mutliple-buttons-to-load-child-swfs-that-i-cant-get-to-work/285034 "2009-03-26T11:17:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fherrmann](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@fherrmann](https://forum.kirupa.com/u/fherrmann)\
**Post date:** [March 26, 2009, 11:17am UTC](https://forum.kirupa.com/t/deadline-today-swf-with-mutliple-buttons-to-load-child-swfs-that-i-cant-get-to-work/285034/1 "2009-03-26T11:17:54Z")

</div>

First off I am really new to the whole actionscript 3 arena and am having a lot of trouble getting things to work. And I have a deadline of today to have this finished…gulp!!!

here is the scenario…I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. I found this code in someone’s post and I am trying to modify it so that works for multiple buttons …it currently works for a button loading a single swf. The name of the instance name of the buttons is the same as the name of the swf file that they load so I thought I could do something that when the button is clicked it would pass the name of the button into the URLRequest but I can’t figure it out. Here is the code I am using.

////////////////////////////////// code from the actions layer  
var bioloader:Loader;  
var biocontainer:MovieClip;

one.addEventListener(MouseEvent.CLICK, biowindow);  
two.addEventListener(MouseEvent.CLICK, biowindow);  
three.addEventListener(MouseEvent.CLICK, biowindow);  
four.addEventListener(MouseEvent.CLICK, biowindow);

function biowindow(e:MouseEvent): void {

```
// I am guessing I should be adding something here like eventname.biowindow + ".swf"
var biorequest:URLRequest = new URLRequest("one.swf");

bioloader = new Loader();
bioloader.load(biorequest);

biocontainer = new MovieClip();
//RS: add to the timeline, not the stage
this.addChild(biocontainer);
biocontainer.addChild(bioloader);

// positions bioloader on stage
biocontainer.x = 0;
biocontainer.y = 0;

trace(biocontainer.stage);
trace(biocontainer.root);

```

}

var receiver:LocalConnection = new LocalConnection();  
receiver.connect(“lcClient”);

receiver.client = this;  
function closeBio(): void {

```
trace("lc called successfully");

biocontainer.removeChild(bioloader);

```

}
