# Toggle Button Display

**URL:** <https://forum.kirupa.com/t/toggle-button-display/229931>\
**Category:** flash\
**Created:** [June 21, 2007, 10:35am UTC](https://forum.kirupa.com/t/toggle-button-display/229931 "2007-06-21T10:35:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mozartmatt](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mozartmatt](https://forum.kirupa.com/u/mozartmatt)\
**Post date:** [June 21, 2007, 10:35am UTC](https://forum.kirupa.com/t/toggle-button-display/229931/1 "2007-06-21T10:35:11Z")

</div>

Hi,

I am currently building a music player. I haven’t been working with flash very long (a few months only) and i’m unsure how to switch between a play and pause button on the stage (i reckon it’s a newbie queston!! lol).

This is the function i’m using to pause and play the track (which works fine… i just duno how to toggle the buttons when you click on them).

function toggle\_pause() {

```
_global.currently_playing;
_global.write_debug;
_global.track_name;

if(currently_playing){
    pos = my_song.position;
    my_song.stop();
    currently_playing = false;
    write_debug = track_name + ': Paused';
    
    // Display Play Button
    
} else {
    if(isset(pos)){
        my_song.start(pos / 1000);
        currently_playing = true;
        write_debug = track_name + ': Resume';
        
        //Display Pause Button
        
    }
}

```

}

Any help appreciated,

Cheers M
