# Simple code trick, maybe?

**URL:** <https://forum.kirupa.com/t/simple-code-trick-maybe/244036>\
**Category:** flash\
**Created:** [November 13, 2007, 8:56pm UTC](https://forum.kirupa.com/t/simple-code-trick-maybe/244036 "2007-11-13T20:56:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wally\_moot](https://avatars.discourse-cdn.com/v4/letter/w/e9bcb4/32.png) [@wally\_moot](https://forum.kirupa.com/u/wally_moot)\
**Post date:** [November 13, 2007, 8:56pm UTC](https://forum.kirupa.com/t/simple-code-trick-maybe/244036/1 "2007-11-13T20:56:40Z")

</div>

how do i nest this function in a way that it only does it once even if the timeline navigates to the frame with this code on it again:

this.gotoAndStop(getRandomLabel());

i tried to put it in a movie clip on a frame outside of the navigation so it never navigates to that frame again, but it still seems to be hitting the frame with this code.

hypothetically, i was hoping for something like:

doOnce.global = function () {  
this.gotoAndStop(getRandomLabel());  
}
