norfy
06-14-2006, 12:59 PM
I've got a space ship that moves to different _x positions and at each point it stops and fires a missle upwards, I'm trying to set a small sound effect against this fire function, but getting nothing out.
I've got a small mp3 file that I have imported to the library and I have called the linkage "laser". Is this all I have to do to get the sound into flash?
Then in my code I have a function that fires the missle so at the top of that function I call a function called playSound(). which looks like this
function playSound(){
trace("bang");
newSound = new Sound();
newSound.attachSound("laser");
newSound.start();
}
But nothing happens when the movie runs. I've tried using the same sound in a test movie and called it when I click on a button and that works, is there something I need to do to script a sound event happening from a function rather than a movie clip event??
Appreciate any help.
Mark
I've got a small mp3 file that I have imported to the library and I have called the linkage "laser". Is this all I have to do to get the sound into flash?
Then in my code I have a function that fires the missle so at the top of that function I call a function called playSound(). which looks like this
function playSound(){
trace("bang");
newSound = new Sound();
newSound.attachSound("laser");
newSound.start();
}
But nothing happens when the movie runs. I've tried using the same sound in a test movie and called it when I click on a button and that works, is there something I need to do to script a sound event happening from a function rather than a movie clip event??
Appreciate any help.
Mark