Playing Sounds: Actionscript Style

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.

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

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.

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:)

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