# Question on sound

**URL:** <https://forum.kirupa.com/t/question-on-sound/34300>\
**Category:** Uncategorized\
**Created:** [October 31, 2003, 1:04am UTC](https://forum.kirupa.com/t/question-on-sound/34300 "2003-10-31T01:04:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NotQuitePerfect](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@NotQuitePerfect](https://forum.kirupa.com/u/NotQuitePerfect)\
**Post date:** [October 31, 2003, 1:04am UTC](https://forum.kirupa.com/t/question-on-sound/34300/1 "2003-10-31T01:04:56Z")

</div>

I’m a relative newbie to Flash, so I’ve been running into a few problems as of late. My #1 problem is getting both an MP3 and a flash movie to load at the same time (without having to click any button)

What I’ve been doing is making a layer for the movie and adding in actionscript: loadMovieNum(“movie.swf”, 0);

Then I make a new layer for the sound and import it, drag it and drop it on the stage from the library and setting it on Start.

When I goto test it, only the movie plays and the sound does not… if I just use control+play, the mp3 does play, but of course no movie.

So, if anyone can tell me what I’m doing wrong or give me alternative script or ideas, it would be much appreciated.

---

<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:** [October 31, 2003, 1:18am UTC](https://forum.kirupa.com/t/question-on-sound/34300/2 "2003-10-31T01:18:09Z")

</div>

That sounds pretty weird. You seem to have done everything correctly. Maybe you should try without the action script and just create one layer with the move and then another layer with 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:** [October 31, 2003, 5:29am UTC](https://forum.kirupa.com/t/question-on-sound/34300/3 "2003-10-31T05:29:44Z")

</div>

You should load in your mp3 externally so your file size goes down and you can stream it in instead. Then you should have no problem with the loaded in movie. It could be a level thing, or a movieClip or instance name issue. Here’s the code:

```auto

myMusic=new Sound();
myMusic.loadSound("yoursong.mp3", true);
//true is for streamed in

```

Make sure your mp3 resides in the same folder as your main movie, or change the path. If you need more info, do a search of the forums using loadSound - you’ll find a bunch of stuff. (-:

---

<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:** [October 31, 2003, 10:05pm UTC](https://forum.kirupa.com/t/question-on-sound/34300/4 "2003-10-31T22:05:37Z")

</div>

I tried both suggestions… won’t work :(… I’m thinking it’s possible it is a level problem because if I set the movie to a higher level it goes rather slowly and the music plays for roughly…1 second then stops

---

<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:** [October 31, 2003, 10:11pm UTC](https://forum.kirupa.com/t/question-on-sound/34300/5 "2003-10-31T22:11:52Z")

</div>

Freddy’s suggestion does work, I can assure you, but I think he forgot the play action. It’s possible that it autoplays when streaming, I don’t know, so I may be wrong though 🙂 You can remove the sound from the timeline, use freddy’s code on the first frame of your movie instead:

```auto

myMusic=new Sound(this);
myMusic.loadSound("yoursong.mp3", true);
myMusic.start(0,999);
//999 is the times to loop

```

And, make sure that yoursong.mp3 is in the same folder as the swf.

---

<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:** [October 31, 2003, 11:26pm UTC](https://forum.kirupa.com/t/question-on-sound/34300/6 "2003-10-31T23:26:15Z")

</div>

I think I did have the start on a movieClip off of the stage. Sorry, thank God Votesjoeba’s here!! Thanks Voet!!

But what’s the ‘this’ for in new Sound(this) ?

---

<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:** [November 1, 2003, 7:59am UTC](https://forum.kirupa.com/t/question-on-sound/34300/7 "2003-11-01T07:59:26Z")

</div>

That’s the target of the sound object. If you have multiple sound objects but you don’t give them targets, changing the volume of one sound object will change the volume of every sound object for example. If you give them targets, you can control each one indepently.
