# Adding variables without button press

**URL:** <https://forum.kirupa.com/t/adding-variables-without-button-press/259090>\
**Category:** flash\
**Created:** [May 1, 2008, 12:41am UTC](https://forum.kirupa.com/t/adding-variables-without-button-press/259090 "2008-05-01T00:41:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![setzer9999](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@setzer9999](https://forum.kirupa.com/u/setzer9999)\
**Post date:** [May 1, 2008, 12:41am UTC](https://forum.kirupa.com/t/adding-variables-without-button-press/259090/1 "2008-05-01T00:41:45Z")

</div>

Hello,

I am trying to create a variable as soon as the playhead reaches a specific frame.

I tried:

onEnterFrame=var variablename:Boolean = new Boolean();  
variablename=true;

but that did not work, of course.

How can I create a variable on a frame without the user having to press a button?

Also, I would like to know how to add a variable to the root movie from a movie that has been loaded externally.

Thank you very much.
