# Audio loops

**URL:** <https://forum.kirupa.com/t/audio-loops/15926>\
**Category:** Uncategorized\
**Created:** [March 19, 2003, 2:22pm UTC](https://forum.kirupa.com/t/audio-loops/15926 "2003-03-19T14:22:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![digletinms](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@digletinms](https://forum.kirupa.com/u/digletinms)\
**Post date:** [March 19, 2003, 2:22pm UTC](https://forum.kirupa.com/t/audio-loops/15926/1 "2003-03-19T14:22:16Z")

</div>

I have a flash project that has 6 scenes. I want the sound to change when I change sceenes. Currently when I move to a new scene the sound that is currently playing continues to play. How can I make it stop once a scene is changed so just the sound attached to the new scene will play.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 19, 2003, 2:36pm UTC](https://forum.kirupa.com/t/audio-loops/15926/2 "2003-03-19T14:36:29Z")

</div>

if it’s the same sound object …

```auto
sound.stop();
sound.attachSound("newsound");
sound.start();

```

that should work =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 19, 2003, 6:15pm UTC](https://forum.kirupa.com/t/audio-loops/15926/3 "2003-03-19T18:15:08Z")

</div>

i would put an action in the first frame of each scene to load the sound and I would make sure that the first line of my actionscript in that frame was:

[AS]stopAllSounds();[/AS]

then i would load the sound and play it in the next line of code.

so that way i would not have multiple loops playing over top of one another

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 6:44pm UTC](https://forum.kirupa.com/t/audio-loops/15926/4 "2003-03-22T18:44:29Z")

</div>

In scene 1 I put this action into first frame of a new layer:

stopAllSounds();  
sound.attachSound(“m-untitled.mp3”);  
sound.start();

No audio is playing when I test the movie. ? How can I get this to work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 6:51pm UTC](https://forum.kirupa.com/t/audio-loops/15926/5 "2003-03-22T18:51:00Z")

</div>

put the stopAllSounds() in the first frame

put the sound.attachSound(“m-untitled.mp”);  
sound.start();

in the second frame

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 22, 2003, 7:16pm UTC](https://forum.kirupa.com/t/audio-loops/15926/6 "2003-03-22T19:16:08Z")

</div>

i tried that but still not getting audio to work. Do I need to select sound in the properties inspector and choose the audio file? I thought that function would be replaced by the action attachSound(“m-untitled.mp”);?

Just don’t know how to get this running right.
