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!
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.