# FMX Help Needed! ActionScipt for Multiple sound toggle!

**URL:** <https://forum.kirupa.com/t/fmx-help-needed-actionscipt-for-multiple-sound-toggle/48347>\
**Category:** Uncategorized\
**Created:** [April 12, 2004, 6:44pm UTC](https://forum.kirupa.com/t/fmx-help-needed-actionscipt-for-multiple-sound-toggle/48347 "2004-04-12T18:44:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mcscratchy](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Mcscratchy](https://forum.kirupa.com/u/Mcscratchy)\
**Post date:** [April 12, 2004, 6:44pm UTC](https://forum.kirupa.com/t/fmx-help-needed-actionscipt-for-multiple-sound-toggle/48347/1 "2004-04-12T18:44:18Z")

</div>

Hello All,  
I have been trying to make a sound control panel in an SWF movie that toggles through about 4 different music tracks. I have not been able to get the if/else statements to work for the button. Could someone tell me what is wrong with this script(below)? 1-4 are the tracks in my library and I have made the export linkage for all them. Any help would be appreciated!

Frame Script  
\_root.music=true;  
\_root.music2=true;  
techno=new Sound();  
techno.attachSound(“1”);  
techno.start();

techno1=new Sound();  
techno1.attachSound(“2”);

techno2=new Sound();  
techno2.attachSound(“3”);

techno3=new Sound();  
techno3.attachSound(“4”)

Object(button) Script

on(release) {  
if(\_root.music == true){  
techno.stop();  
techno1.start();  
\_root.music=false;  
} else {  
techno1.stop();  
techno2.start();  
\_root.music=true;  
}

if(\_root.music == true){  
techno.stop();  
techno1.start();  
\_root.music=false;  
} else {  
techno1.stop();  
techno2.start();  
\_root.music=true;  
}  
}
