# Loading a variable to do something

**URL:** https://forum.kirupa.com/t/loading-a-variable-to-do-something/93577
**Category:** Uncategorized
**Created:** [November 2, 2003, 5:38am UTC](https://forum.kirupa.com/t/loading-a-variable-to-do-something/93577 "2003-11-02T05:38:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Freddythunder](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@Freddythunder](https://forum.kirupa.com/u/Freddythunder)
#### Post date: [November 2, 2003, 5:38am UTC](https://forum.kirupa.com/t/loading-a-variable-to-do-something/93577/1 "2003-11-02T05:38:13Z")

</div>

I actually had it working earlier, but accidentaly erased the code that made it work. I have a text file that says:  
taken=x7y7  
Now, what I want Flash to do with that is tell a movieClip called x7y7 to gotoAndStop(2);. I think I used LoadVars() to get it to work. This was the last chuck of code that I tried:

```auto

lv = new LoadVars();
lv.onLoad = function (success){
if (success){
_root.crap = this.taken;
trace (crap);
_root[crap].gotoAndStop(2);
}
}
lv.load("taken.txt");

```

I’m using the individual pieces of code in other places, so I know that it works, just not here. Am I missing something?? Or does anyone have a different idea??
