# Playing Sounds: Actionscript Style

**URL:** <https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147>\
**Category:** flash\
**Created:** [August 9, 2002, 1:33pm UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147 "2002-08-09T13:33:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeonGold](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@NeonGold](https://forum.kirupa.com/u/NeonGold)\
**Post date:** [August 9, 2002, 1:33pm UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147/1 "2002-08-09T13:33:15Z")

</div>

Hi there… is there a way to play a sound (like a wav or mp3 that is inside your library) just by using actionscript?

I’m planning on using something like

if (attpow1 \> 0)  
{attack = “Hiten Mitsurugi Ryu Kuryuzusen”;  
\<actionscript for playing soundfile here\>;  
}

I hope someone knows how, thanks.

---

<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:** [August 9, 2002, 1:49pm UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147/2 "2002-08-09T13:49:27Z")

</div>

That may work exept if you go to upload it to a web site or something like that the sound will mostlikely not be there because you don’t upload the library itself…i think.

:nerd: happy flashing :bandit:

=) mdipi

---

<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:** [August 9, 2002, 2:05pm UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147/3 "2002-08-09T14:05:54Z")

</div>

it won’t be on the web. I just want it to be placed inside my friends’ hard drives ehhee… anyway it’s gonna be big. So how do we go about the sound playing using actionscript problem? Any sample code? I found one for Flash 5 but I’m not sure it would work… tried it but I can’t seem to make it work right.

---

<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:** [August 9, 2002, 5:59pm UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147/4 "2002-08-09T17:59:54Z")

</div>

You can load a sound in from your library if you want, however the draw back to this is that depending on the size of the mp3 it could inflate your file size of your main site. The code for attaching a sound from you library is:  
onClipEvent(load){  
mySound = new Sound();  
mySound.attachSound(“myMP3”)  
}  
remeber that you have to right click on your mp3 in your library, select linkage and clikc export for actionscript and give it any name that you want.  
My prefered method is to load the sound using an external swf.

onClipEvent(load){  
loadMovieNum(“sound.swf”, 1);  
}  
Hope this helps.

Kyle:)

---

<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:** [August 10, 2002, 6:42am UTC](https://forum.kirupa.com/t/playing-sounds-actionscript-style/1147/5 "2002-08-10T06:42:52Z")

</div>

Thanks! That’s the one similar to what I’m looking for! I’ll try it heheh… thanks again.
