Hi,
I want to create a shortcut with the key ‘f1’. If pressed the movieobject ‘uitleg’ visible property will be true, the movie object is actually nothing but some text which explains what to do. When pressing f1 again the visible property will go false again and you can continue with the game.
I hoped the following code would work, but nothing happens at all. If i remove the && (uitleg._visible = false) it does work, but I wouldn’t know how else to set the property back to false when pressing the f1 key again.
uitleg._visible = false;
keyListener = new Object();
keyListener.onKeyDown = function() {
if ((Key.getCode() == 112) && (uitleg._visible = false)){
uitleg._visible = true;
} else if ((Key.getCode() == 112) && (uitleg._visible = true)) {
uitleg._visible = false;
}
}
Key.addListener(keyListener);