When my game character is hitting the computers, and spacebar is pressed the animation changes to gotoAndStop(2). This is working so far.
What i want is so that when i press the spacebar again it goes back to gotoAndStop(1)
How would i go about doing this?
Here's my code:
public function turnOn(event:KeyboardEvent)
{
if(jon.hitTestObject(computers) && event.keyCode == 32)
{
computers.gotoAndStop(2);
}
}