you can use the following to trigger your button event:
Thanks kglad for your reply, could you show me how to write this into my code as I tried this earlier and it gave me back an error, i think I just wrote it wrong.
just copy and paste the code i showed.
it just needs to be pasted within the scope of btn.
Thanks..I pasted it bellow the first button event, and when I run the swf, it just plays my sound randomly,I wanted to attach it to a keyboard event where if i click just say spacebar it will click that button and trigger my sound. I can see where your coming from.
1 person found this helpful
then add a keyboardevent listener to execute that code:
Thanks, this was the code I added in the end and it works nicely, It covers my sound and id3 aswell as Im displaying lcd text in a dynamic text box.
if (event.keyCode == 83)
var url:String = "Savage.mp3";
var request:URLRequest = new URLRequest(url);
var s:Sound = new Sound();