-
Help with Adding Audio in on (keyPress) Listener
Hi Guys! I'm trying to create a program that is supposed to stop the audio from playing at the start and only play it when the "x" key is pressed. stop() is successful but somehow, the audio just won't play.
Please help.
My Audio is a 1-second file named "Buzzer.mp3".
Location:
My flash file is in the same location as the folder "Audio" which contains the Buzzer.mp3 file.
In properties,
Identifier: Buzzer
AS 2.0 class: xAudio
Here's the code located in the frame:
var wrong:Sound = new Sound(new URLRequest("Audio/Buzzer"));
_root.wrong.stop();
Here's the code located at the button property:
on(keyPress "x") {
var wrang:Sound = new Sound(new URLRequest("Audio/Buzzer"));
_root.wrang.play();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|