# Hide/show with only one button

**URL:** https://forum.kirupa.com/t/hide-show-with-only-one-button/327557
**Category:** Uncategorized
**Created:** [March 9, 2012, 10:54am UTC](https://forum.kirupa.com/t/hide-show-with-only-one-button/327557 "2012-03-09T10:54:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![daAS3noob](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@daAS3noob](https://forum.kirupa.com/u/daAS3noob)
#### Post date: [March 9, 2012, 10:54am UTC](https://forum.kirupa.com/t/hide-show-with-only-one-button/327557/1 "2012-03-09T10:54:54Z")

</div>

so i’m new to as3 and flash and i’ve just made my first steps…

I’m not happy with my hide/show function… the code works, but I think it is a waste of space on my stage that I need two buttons to hide and show a movieclip… there must be a better way

```auto
//play_ani_button
play_ani_button.addEventListener(MouseEvent.CLICK, hideObject);

function hideObject(event:MouseEvent):void {
    description.visible=false;
    story1.enabled=true;
    play_ani_button.enabled=false;
}

//story button
story1.addEventListener(MouseEvent.CLICK, showObject);

function showObject(event:MouseEvent):void {
    description.visible=true;
    story1.enabled=false;
    play_ani_button.enabled=true;
}

```

so my question is: How I have to change my code, that I only have to use one button?

sry for my bad english, but it isn’t my native language (like as3 :p)
