# Show / Hide Movies

**URL:** <https://forum.kirupa.com/t/show-hide-movies/226601>\
**Category:** flash\
**Created:** [May 22, 2007, 3:34pm UTC](https://forum.kirupa.com/t/show-hide-movies/226601 "2007-05-22T15:34:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chavs](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@Chavs](https://forum.kirupa.com/u/Chavs)\
**Post date:** [May 22, 2007, 3:34pm UTC](https://forum.kirupa.com/t/show-hide-movies/226601/1 "2007-05-22T15:34:41Z")

</div>

Hi there,  
I’ve created a movie clip that will act as a corsor, and when a key is pressed it will show and hide, between two movie clips. The two clips have instance variables setup - castle\_in and castle\_out.

Also, can i make it so it’s binded to a letter-key for instance, rather than the mouse as it is right now?

This is my code but it only works after one press:

```auto

_root.castle_out._visible = false;
_root.castle_in._visible = true;

_root.spotter.onPress = function() {
    if (_root.castle_out._visible=true) {
        _root.castle_in._visible = true;
        _root.castle_out._visible = false;
    }
    if (_root.castle_in._visible=true) {
        _root.castle_in._visible = false;
        _root.castle_out._visible = true;
    }
};

```

Any help will be helpful thanks,

Chavs
