# \[as 2.0\] using f1 to show help in a flash movie

**URL:** <https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831>\
**Category:** flash\
**Created:** [June 10, 2008, 1:26pm UTC](https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831 "2008-06-10T13:26:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lowen\_f](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lowen_f/32/1656_2.png) [@lowen\_f](https://forum.kirupa.com/u/lowen_f)\
**Post date:** [June 10, 2008, 1:26pm UTC](https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831/1 "2008-06-10T13:26:14Z")

</div>

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.

```auto

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);

```

---

<div class="post-metadata">

**Author:** ![Pilot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@Pilot](https://forum.kirupa.com/u/Pilot)\
**Post date:** [June 10, 2008, 5:32pm UTC](https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831/2 "2008-06-10T17:32:01Z")

</div>

Should be uitleg.\_visible == false in the if-class i think… also at the else if double “=”

I think one “=” is the same as not equal…? am I right…?

---

<div class="post-metadata">

**Author:** ![lowen\_f](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lowen_f/32/1656_2.png) [@lowen\_f](https://forum.kirupa.com/u/lowen_f)\
**Post date:** [June 10, 2008, 5:52pm UTC](https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831/3 "2008-06-10T17:52:56Z")

</div>

ah! didn’t know you had to use double “=” in an if statement. thx for the help! it’s solved and I can resume my school project. 🙂

---

<div class="post-metadata">

**Author:** ![zuperxtreme](https://avatars.discourse-cdn.com/v4/letter/z/e9a140/32.png) [@zuperxtreme](https://forum.kirupa.com/u/zuperxtreme)\
**Post date:** [June 10, 2008, 7:35pm UTC](https://forum.kirupa.com/t/as-2-0-using-f1-to-show-help-in-a-flash-movie/262831/4 "2008-06-10T19:35:21Z")

</div>

> [@lowen.f;2340204](#):
>
> ah! didn’t know you had to use double “=” in an if statement. thx for the help! it’s solved and I can resume my school project. 🙂

You don’t have to, but you can’t use a single =.

You either do:

if ((Key.getCode() == 112) && (!uitleg.\_visible)){

or

if ((Key.getCode() == 112) && (uitleg.\_visible==false)){
