Playing laser sound while pressing spacebar as3

Trying to figure out a code for my ship when i press spacebar and fires the laser a sound will play

private var reqButton:URLRequest = new URLRequest("laser.mp3");
private var buttonSound:Sound = new Sound(reqButton);

if (key.isDown(Keyboard.SPACE))

ok this worked the only 2 things i need was to add



You can try this if you have an external sound in an "audio" folder

var reqButton:URLRequest = new URLRequest("audio/button.mp3"); 
var buttonSound:Sound = new Sound(reqButton);

and then your keypress code:

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
    function keyDown(event:KeyboardEvent):void

        case 32:  //Space Bar 
            //trace("Space Bar");


Need Your Help

Pass the value by using href

jquery html jqgrid

I use the following formatter option for add href button in last column of the jqgrid.Its working Fine.

How to find the exact match using GREP

regex bash grep

HI I have a fairly big Log File and want to see which sort of website being requested.