[FMX] my very simple car

Hi there, I’m new to this forum and I’m a complete n00b in Flash and ActionScript,
I’m making this simple flash that allows you to turn on/off the lights of a car. the solution I came up with “works”, but on fast computers (actually just any computer) the light blinks, unless you tap the button quickly. (if you look at the code you can see why).

my solution is pretty simple

[AS]
lights = 0;

if(key.IsDown(key.SPACE) && lights == 0)
{
var color = new Color(“car.drasl3”);
color.setRGB(0xFFFF00);
lights = 1;
} else if(key.IsDown(key.SPACE) && lights == 1)
{
var color = new Color(“car.drasl3”);
color.setRGB(0xFFFFFF);
lights = 0;
}
[/AS]

I know there has to be a better solution to this problem, if anyone could help the n00b out would be great.

thx, Sicarius