# Sound Help

**URL:** <https://forum.kirupa.com/t/sound-help/257116>\
**Category:** Uncategorized\
**Created:** [April 10, 2008, 11:27am UTC](https://forum.kirupa.com/t/sound-help/257116 "2008-04-10T11:27:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZacMarkham](https://avatars.discourse-cdn.com/v4/letter/z/df788c/32.png) [@ZacMarkham](https://forum.kirupa.com/u/ZacMarkham)\
**Post date:** [April 10, 2008, 11:27am UTC](https://forum.kirupa.com/t/sound-help/257116/1 "2008-04-10T11:27:41Z")

</div>

I am using the following code on the first frame of my movie to set up my background music:

```auto

mysound = new Sound();
mysound.attachSound("Blue Wrath");
mysound.start(0,99);
var song = "blue";

```

I then have the following code in a button:

```auto

on(release)
{
    if(song == "blue")
    {
        mysound.stop();
        mysound.attachSound("Queen");
        mysound.start(0,99);
        song = "Queen";
    }
    
    else if(song == "Queen")
    {
        mysound.stop();
        mysound.attachSound("blue");
        mysound.start(0,99);
        song = "blue";
    }
}

```

I want it to basically switch between the two sounds when the button is pressed but instead it just plays the “blue” sound on top of the previous “blue” sound. Can anyone help?
