# How to store variables?

**URL:** <https://forum.kirupa.com/t/how-to-store-variables/263472>\
**Category:** flash\
**Created:** [June 16, 2008, 2:47pm UTC](https://forum.kirupa.com/t/how-to-store-variables/263472 "2008-06-16T14:47:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fstekols\_gmail](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@fstekols\_gmail](https://forum.kirupa.com/u/fstekols_gmail)\
**Post date:** [June 16, 2008, 2:47pm UTC](https://forum.kirupa.com/t/how-to-store-variables/263472/1 "2008-06-16T14:47:00Z")

</div>

So i think i’m pretty close. Basically I’m trying to store instance names of the currentTarget in a variable by using the instance name of an object that is on the stage. I know how to do it with as2, but I’m having trouble translating to as3. I’m using an “if statement” so if the variable is null it does one thing, then if the variable has the instance name then it does the if statement for the object of the instance name that it is holding, then the instance name is supposed to be taken over by the new button that was just pressed. I’ll zip up the fla file, hopefully this will make more sense.
