# Loading Multiple SWFs from different pages into LoaderMax

**URL:** <https://forum.kirupa.com/t/loading-multiple-swfs-from-different-pages-into-loadermax/329835>\
**Category:** flash\
**Created:** [October 22, 2012, 8:01pm UTC](https://forum.kirupa.com/t/loading-multiple-swfs-from-different-pages-into-loadermax/329835 "2012-10-22T20:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngrinchenko](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@ngrinchenko](https://forum.kirupa.com/u/ngrinchenko)\
**Post date:** [October 22, 2012, 8:01pm UTC](https://forum.kirupa.com/t/loading-multiple-swfs-from-different-pages-into-loadermax/329835/1 "2012-10-22T20:01:58Z")

</div>

[COLOR=#222222][FONT=Helvetica Neue]Hi,  
I have a page with various image buttons (page1). From this page I am accessing another page (page2) where greensock’s SWF loader is constructed and loads multiple SWFs from the first page (page1). These larger SWFs are corresponding to various buttons on the first page (page1).  
For that I have set up a var on page1:

```auto

var sourceVar_ProductsPopUps:String;

```

then each button has a code like this:  
then I use this var in all the buttons

```auto

function onClickSumix16RGBPopUp(event:MouseEvent) :void {
sourceVar_ProductsPopUps="prdcts_popups/Sumix16RGB-popup_tl.swf";
gotoAndPlay("(page2");
}

```

Then this var is used in the SWF loader construction on page2:

```auto

loaderProductPopUps = new SWFLoader(sourceVar_ProductsPopUps,

```

Then I wanted to have additional buttons on page2 and load other SWF files into that same SWF loader on page2.  
So I used the same code. I made a button and this is my script from a button on page2:

```auto

tryDelete_mc.addEventListener(MouseEvent.CLICK, onClicktryDelete_mc);

function onClicktryDelete_mc(event:MouseEvent):void {sourceVar_ProductsPopUps = event.currentTarget.prop;
}

```

Why it doesn’t work in the second case?  
[/FONT][/COLOR]
