# "mp3 player"

**URL:** <https://forum.kirupa.com/t/mp3-player/11906>\
**Category:** flash\
**Created:** [January 23, 2003, 7:20pm UTC](https://forum.kirupa.com/t/mp3-player/11906 "2003-01-23T19:20:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![funkyjones](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@funkyjones](https://forum.kirupa.com/u/funkyjones)\
**Post date:** [January 23, 2003, 7:20pm UTC](https://forum.kirupa.com/t/mp3-player/11906/1 "2003-01-23T19:20:14Z")

</div>

Hmm, when I´ve done this:

mySound = new Sound()  
mySound.attachSound(Mymuzik);  
mySound.play()

Can i with buttons someway add sounds to mySound with out having it in a layer?.  
I thinking of doin a sort of “mp3 player”.  
Shall i then put sounds in MCs and tell mySound to attachSound that are in an MC?  
Help me, need som tip or a tutorial to do this.  
Cheers!

---

<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:** [January 24, 2003, 3:10pm UTC](https://forum.kirupa.com/t/mp3-player/11906/2 "2003-01-24T15:10:04Z")

</div>

A couple of things …

First of all, the syntax is

mySound= new Sound()  
mySound.attachSound(“mySoundInstanceName”)  
mySound.start()

new Sound() instantiates a new sound object and takes the optional argument location e.g. new Sound(this), new Sound(\_root), new Sound(\_level0). If you don’t specify a location it defaults to this.

mySoundInstanceName is the linkage you give the sound when you export it. start() takes two arguments - start(offset, loops) so if you have a 5 sec loop and you want to play the last three seconds fifty times specify start(2,50)

Once you’ve created your sound object you reference it by dot syntax the same way as you’d reference any other object like, for example, a MC instance - e.g. \_root.soundholder.mySound.setVolume(34) - and you can place your sound Object and your button anywhere you like.
