# FrameLabel to var listener

**URL:** <https://forum.kirupa.com/t/framelabel-to-var-listener/320182>\
**Category:** flash\
**Created:** [March 16, 2011, 4:26am UTC](https://forum.kirupa.com/t/framelabel-to-var-listener/320182 "2011-03-16T04:26:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WILWILWEL](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@WILWILWEL](https://forum.kirupa.com/u/WILWILWEL)\
**Post date:** [March 16, 2011, 4:26am UTC](https://forum.kirupa.com/t/framelabel-to-var-listener/320182/1 "2011-03-16T04:26:23Z")

</div>

I’m trying to make a listener for catching the currentFrameLabel.

It should listen to changes when entering another framelabel on stage and do this until the page visitor leaves the page.

now i have:

> this.addEventListener (Event.ENTER\_FRAME, test);  
> function test (e:Event) {  
> var lol = MovieClip(root).currentLabel;  
> trace (lol);  
> this.removeEventListener (Event.ENTER\_FRAME, test);  
> }

this is not the right sollution because it catches the framelabel and stop the function.

> this.addEventListener (Event.ENTER\_FRAME, test);  
> function test (e:Event) {  
> var lol = MovieClip(root).currentLabel;  
> trace (lol);  
> }

this is not gonna work well because it keeps looping over and over, it might slow down the session. And it keeps refreshing the “lol” var.

How can i achieve that the listener keeps working but doesnt constantly refresh the var. Like a sort of pause were it starts again when it detects a change of frame label
