# How can I use AS to figure out which frame the playhead is at?

**URL:** <https://forum.kirupa.com/t/how-can-i-use-as-to-figure-out-which-frame-the-playhead-is-at/239934>\
**Category:** flash\
**Created:** [September 27, 2007, 12:37pm UTC](https://forum.kirupa.com/t/how-can-i-use-as-to-figure-out-which-frame-the-playhead-is-at/239934 "2007-09-27T12:37:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elburrodiablo](https://avatars.discourse-cdn.com/v4/letter/e/49beb7/32.png) [@elburrodiablo](https://forum.kirupa.com/u/elburrodiablo)\
**Post date:** [September 27, 2007, 12:37pm UTC](https://forum.kirupa.com/t/how-can-i-use-as-to-figure-out-which-frame-the-playhead-is-at/239934/1 "2007-09-27T12:37:22Z")

</div>

I’m trying to create a button that functions a bit differently depending on which frame the playhead is located. Below is my code. Obviously, the property “FRAME” is undefined. How do I define that property as the current location of the playhead (ie which frame in the timeline we are currently on)

```auto
 function AudioControl(evt:Event):void{
    if (FRAME < 215){
        function AudioOff(evt:Event):void{
            gotoAndStop("End");
        }
    }else{
        function AudioOn(evt:Event):void{
            gotoAndPlay("Start");
        }
    }
}
    
bAudioControl.addEventListener(MouseEvent.CLICK, AudioControl);

```

Thanks for any help or suggestions!!!
