PDA

View Full Version : [AS2] p for Pause???


Joeeyt
01-15-2010, 08:29 AM
Hi, ive made an action game using flash 8 and im wondering how to make the pause button pop up if i press 'p' but theres one problem...how do i write if (Key.isDown(Key.p))??????????

Joeeyt
01-15-2010, 02:37 PM
Can anyone help im trying to make a pause button 'p' for which stops all actionscript ahead of it kinda like
onClipevent(load);
whatever code for pause lol.....
}
onClipEvent(enterframe);
if (Key.isDown(Key.UP)...so on and so on....
ive tried sooo many codes but they all dont work can someone please help me!!!!!!!!!!

Informatik
01-15-2010, 03:06 PM
Calm down...

function onKeyDown():Void
{
if( String.fromCharCode(Key.getAscii()) == "p" )
{
// pause actions
}
}

Key.addListener(this);