# SUPER URGENT! One button controlling two placeholders

**URL:** <https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449>\
**Category:** Uncategorized\
**Created:** [April 13, 2006, 1:50pm UTC](https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449 "2006-04-13T13:50:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_scape](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@e\_scape](https://forum.kirupa.com/u/e_scape)\
**Post date:** [April 13, 2006, 1:50pm UTC](https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449/1 "2006-04-13T13:50:48Z")

</div>

Hi,

I am really desperate to solve this. If anyone can help me I would appreciate it.

I have two place holders: _holder\_text\_mc and holder\_img\_mc_.

I have a navbar with 6 buttons. The idea is that when you click on a button (lets call it ‘about’), the text for that category (about\_text.swf) should load into the holder\_text\_mc and the image for the category (about\_img.swf) should load into the holder\_img\_mc.

Then if you click on another button (lets say ‘contact us’) the previous (about) swf’s should fade out and the ‘contact us’ swf’s fade in. (contact\_tex.swf into the holder\_text\_mc and contact\_img.swf into the holder\_img\_mc etc…)

I have tested the code below when using only holder\_text\_mc and everything works fine. But as soon as I put the holder\_img\_mc into it, the button loads the same swf into both holders!!!

Here is the AS for the button: As I said with only one button action, it works fine but as soon as I put the action for the second holder - It loads the same swf into both holders!

}  
on (release) {  
\_root.nextMovie=(‘about\_text.swf’);  
\_root.holder\_text\_mc.gotoAndPlay(‘out’)  
}  
on (release) {  
\_root.holder\_img\_mc.nextMovie=(‘about\_img.swf’);  
\_root.holder\_img\_mc.gotoAndPlay(‘out’)  
}

This is the AS from the main timeline for the two holders in the ‘home’ state. It seems to work fine which leads me to think that my problem is with the AS on the button???

holder\_text\_mc.loadMovie(‘home.swf’);  
preloader\_mc.\_alpha=0;  
preloader\_mc.onEnterFrame=function(){  
l=holder\_text\_mc.getBytesLoaded();  
t=holder\_text\_mc.getBytesTotal();  
p=Math.round((l/t)\*100)  
if(p\<100){  
if(this.\_alpha\<100){  
this.\_alpha+=10  
}  
preloader\_mc.gotoAndStop§  
}else{  
preloader\_mc.gotoAndStop(100)  
if(holder\_text\_mc.\_currentframe==1){  
holder\_text\_mc.gotoAndPlay(‘in’);  
}  
if(this.\_alpha\>0){  
this.\_alpha-=10  
}

}  
}

holder\_img\_mc.loadMovie(‘home\_img.swf’);  
preloader\_mc3.\_alpha=0;  
preloader\_mc3.onEnterFrame=function(){  
l=holder\_img\_mc.getBytesLoaded();  
t=holder\_img\_mc.getBytesTotal();  
p=Math.round((l/t)\*100)  
if(p\<100){  
if(this.\_alpha\<100){  
this.\_alpha+=10  
}  
preloader\_mc3.gotoAndStop§  
}else{  
preloader\_mc3.gotoAndStop(100)  
if(holder\_img\_mc.\_currentframe==1){  
holder\_img\_mc.gotoAndPlay(‘in’);  
}  
if(this.\_alpha\>0){  
this.\_alpha-=10  
}

}  
}

I hope I have been clear. Please help me - I really need it!

---

<div class="post-metadata">

**Author:** ![williby27](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/williby27/32/1501_2.png) [@williby27](https://forum.kirupa.com/u/williby27)\
**Post date:** [April 13, 2006, 3:03pm UTC](https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449/2 "2006-04-13T15:03:21Z")

</div>

> [@e-scape](#):
>
> Then if you click on another button (lets say ‘contact us’) the previous (about) swf’s should fade out and the ‘contact us’ swf’s fade in. (contact\_tex.swf into the holder\_text\_mc and contact\_img.swf into the holder\_img\_mc etc…

You sure you havent forgotten to add the ‘t’ to contact\_text.swf ??

---

<div class="post-metadata">

**Author:** ![e\_scape](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@e\_scape](https://forum.kirupa.com/u/e_scape)\
**Post date:** [April 13, 2006, 3:08pm UTC](https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449/3 "2006-04-13T15:08:23Z")

</div>

> [@williby27](#):
>
> You sure you havent forgotten to add the ‘t’ to contact\_text.swf ??

Yeah, I’m sure. the file names are for example anyway. It’s got me quite puzzled!

Thanks for your help anyway!

---

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [April 13, 2006, 4:55pm UTC](https://forum.kirupa.com/t/super-urgent-one-button-controlling-two-placeholders/185449/4 "2006-04-13T16:55:47Z")

</div>

post a fla…i cant stand trying to work out peoples stuff from a massive, long post…

oh and use [as] [/as] tags to wrap your as… 😉
