# Saving text as a variable

**URL:** https://forum.kirupa.com/t/saving-text-as-a-variable/132462
**Category:** Uncategorized
**Created:** [December 28, 2004, 11:13pm UTC](https://forum.kirupa.com/t/saving-text-as-a-variable/132462 "2004-12-28T23:13:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)
#### Post date: [December 28, 2004, 11:13pm UTC](https://forum.kirupa.com/t/saving-text-as-a-variable/132462/1 "2004-12-28T23:13:10Z")

</div>

Here’s my issue. I want to save a string of text as a variable. My code is this:

\_global.scene\_txt = “btnHome”;

I am then using that variable in the code:

on (rollOut) {  
slider.yMove = \_global.scene\_txt.\_y;  
}

I’m creating a sliding menu selector on my site.

Slider is the name of my movieclip instance that slides along the menu.

“btnHome” is the instance name of the button that I want it to slide to.

I’ve tried to set the variable a couple different ways. Without the “\_global.” I’ve tried using the “var” command. I’ve tried putting in the actual instance name (btnHome) in the second code and it works fine, which means it’s not a problem with the code elsewhere. It’s just not recognizing “\_global.scene\_txt” as “btnHome”

None of them have worked.

I’m still very new to flash, so any help is greatly appreciated. Or if you need more information…

Thanks,  
iLan
