# Event handler that executes on load

**URL:** <https://forum.kirupa.com/t/event-handler-that-executes-on-load/179122>\
**Category:** Uncategorized\
**Created:** [February 16, 2006, 8:30pm UTC](https://forum.kirupa.com/t/event-handler-that-executes-on-load/179122 "2006-02-16T20:30:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tod](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@Tod](https://forum.kirupa.com/u/Tod)\
**Post date:** [February 16, 2006, 8:30pm UTC](https://forum.kirupa.com/t/event-handler-that-executes-on-load/179122/1 "2006-02-16T20:30:54Z")

</div>

I need an event handler that executes only once when the root movie has loaded. If I later on return to the first frame that holds the script it should not execute again.

something like "when\_root\_has\_loaded = function(){ some code};

Thanks
