Space bar as pause. Using as2 and netsream

Hey guys. Checking if anybody can help me here.
Looking to use the space bar as a pause button/function for my flv player.
I’ve done it before using onEnterframe but I’m battling to get it to work with the netstream, any ideas/help?

Here are the two sets of code I worked on:

*onEnterFrame = function()
{
check_keys();
}

function check_keys()
{
if(!Key.isDown(Key.SPACE))
{
ns.pause();
}
}

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown)
function keyDown() {
if (!Key.isDown(key.SPACE)) {
if (ns.pause(false)
ns.pause(true)
else
ns.pause(false)
}
}

*Cheers and thanks in advance for ANY help.