# (MX 2004) Load to one of two containers?!

**URL:** <https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739>\
**Category:** flash\
**Created:** [April 7, 2006, 11:06am UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739 "2006-04-07T11:06:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [April 7, 2006, 11:06am UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739/1 "2006-04-07T11:06:38Z")

</div>

[SIZE=3][FONT=Times New Roman]Hey peeps.[/FONT][/SIZE]  
[FONT=Times New Roman][SIZE=3](this could be difficult to explain, esp on a friday :puzzle:!!) [/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]I have this code [COLOR=red]below [/COLOR][COLOR=black]which works well to a certain extent. This code is on the ‘PROFILE.swf’. On this page there is a sub menu containing 4 buttons: [COLOR=red][COLOR=blue]Biogs,[/COLOR] Awards, Charity, Publications.[/COLOR] When one of the the last 3 buttons are clicked the text already on the page fades away and the relevant, new, swf is loaded in place. Now because within each new swf there are more catergories in the sub menu to choose from, the buttons are also loaded with the new swf. [/COLOR][/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]This means that after the first button is clicked, this code nolonger works as the target path changes. Initially the buttons are in Container2, then once the first button is loaded the buttons are in sub\_cntr. My question is: Is it possible to write the code so that the target path is checked to both CONTAINER2 and SUB\_CNTR? :q: [/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]Any questions, if not understood, please ask![/SIZE][/FONT]

[SIZE=3][SIZE=3][FONT=Times New Roman]arrName = [“awards.swf”,“charity.swf”,“publications.swf”]  
function sub\_menu(refName) {  
\_root.container2.main\_txt.\_alpha = 0;  
\_root.container2.sub\_txt.\_alpha = 0;  
\_root.container2.loadMovie(refName);  
\_root.container2.alphaTo(100,1,“easeOutCubic”);  
}[/FONT][/SIZE]  
[SIZE=3][FONT=Times New Roman]\_root.container2.btns\_mc.awards\_btn.onRelease = function () {  
sub\_menu(arrName[0]);  
\_root.sub\_cntr.unloadMovie(“charity.swf”, “publications.swf”)  
}

\_root.container2.btns\_mc.charity\_btn.onRelease = function () {  
sub\_menu(arrName[1]);  
\_root.container2.btns\_mc.unloadMovie(“awards.swf”,“publications.swf”)  
}

\_root.container2.btns\_mc.publications\_btn.onRelease = function () {  
sub\_menu(arrName[2]);  
\_root.container2.btns\_mc.unloadMovie(“awards.swf”,“charity.swf”)  
}[/FONT][/SIZE]  
[/SIZE]

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [April 7, 2006, 5:00pm UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739/2 "2006-04-07T17:00:09Z")

</div>

Why dotn you try something like

```auto
whereAmI = "container2";
_root[whereAmI].btns_mc.publications_btn.onReleas e = function () {
sub_menu(arrName[2]);
_root[whereAmI].btns_mc.unloadMovie("awards.swf", "charity.swf")
}

```

It should work for the unloadMovie, but Im not sure with the function declaration… I have never tried that 🙂

---

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [April 10, 2006, 9:49am UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739/3 "2006-04-10T09:49:41Z")

</div>

Thanks…if whereAmI = [COLOR=red]“container2”[/COLOR] there is still no reference to Sub\_cntr?!

Can the OR || operator be used in this situation?! Never used it before though! :-/

---

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [April 10, 2006, 2:27pm UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739/4 "2006-04-10T14:27:45Z")

</div>

Anyone got anymore input?! :ear:

---

<div class="post-metadata">

**Author:** ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)\
**Post date:** [April 11, 2006, 11:51am UTC](https://forum.kirupa.com/t/mx-2004-load-to-one-of-two-containers/184739/5 "2006-04-11T11:51:46Z")

</div>

There must be a simple solution?! Other than repeating the code to target both containers! Which i’m sure will just confuse Flash!
