# External Music Files

**URL:** https://forum.kirupa.com/t/external-music-files/59075
**Category:** Uncategorized
**Created:** [July 28, 2004, 6:16am UTC](https://forum.kirupa.com/t/external-music-files/59075 "2004-07-28T06:16:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)
#### Post date: [July 28, 2004, 6:16am UTC](https://forum.kirupa.com/t/external-music-files/59075/1 "2004-07-28T06:16:34Z")

</div>

I currently use:

```auto

mySound = new Sound();
mySound.loadSound("music.mp3",true);

```

1.) How do I set the number of loops?  
2.) What is the Actionscript code to unload the sound?

---

<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: [July 28, 2004, 7:14am UTC](https://forum.kirupa.com/t/external-music-files/59075/2 "2004-07-28T07:14:19Z")

</div>

**1)** mySound.start(secondOffset,loop);

_secondOffset_ An optional parameter that lets you start playing the sound at a specific point. For example, if you have a 30-second sound and want the sound to start playing in the middle, specify 15 for the secondOffset parameter. The sound is not delayed 15 seconds, but rather starts playing at the 15-second mark.

_loop_ An optional parameter allowing you to specify the number of times the sound should play consecutively.

**2)** you can unload the sound with

delete mySound;

---

<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: [July 29, 2004, 4:50am UTC](https://forum.kirupa.com/t/external-music-files/59075/3 "2004-07-29T04:50:46Z")

</div>

I did this (below) and the music didn’t loop.

```php

mySound = new Sound();
mySound.loadSound("music.mp3",true);
mySound.start(0,99);

```

---

<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: [July 29, 2004, 3:05pm UTC](https://forum.kirupa.com/t/external-music-files/59075/4 "2004-07-29T15:05:46Z")

</div>

Hey neo, I had the same problem as well in a previous project I made. For some reason the mp3 did not loop until it ended once. So for example, my 15 seconds mp3 started 15 seconds after mySound was loaded. I put a temporary fix on it by using a setInterval command. I never did find a real fix for it.

---

<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: [July 30, 2004, 3:54am UTC](https://forum.kirupa.com/t/external-music-files/59075/5 "2004-07-30T03:54:38Z")

</div>

> [@bobdoe](#):
>
> Hey neo, I had the same problem as well in a previous project I made. For some reason the mp3 did not loop until it ended once. So for example, my 15 seconds mp3 started 15 seconds after mySound was loaded. I put a temporary fix on it by using a setInterval command. I never did find a real fix for it.

I cannot follow you. Sorry; I am only a beginning Actionscripter. So what is the whole script for infinitely looping an external MP3?

---

<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: [July 30, 2004, 4:58am UTC](https://forum.kirupa.com/t/external-music-files/59075/6 "2004-07-30T04:58:23Z")

</div>

well i used your exact same code and had the exact same problem. What I did to fix it is not that good. I think you should find some kind of official fix for this problem.
