# Loaded variable problem with animated text box

**URL:** <https://forum.kirupa.com/t/loaded-variable-problem-with-animated-text-box/223923>\
**Category:** Uncategorized\
**Created:** [April 26, 2007, 8:15pm UTC](https://forum.kirupa.com/t/loaded-variable-problem-with-animated-text-box/223923 "2007-04-26T20:15:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [April 26, 2007, 8:15pm UTC](https://forum.kirupa.com/t/loaded-variable-problem-with-animated-text-box/223923/1 "2007-04-26T20:15:38Z")

</div>

I’ve got a dynamic text box which is animated onto the stage from the right, it stalls in the center of the stage, then tweens off the stage to the left.  
So if you can picture it there are 4 separate key frame for the entire tween.  
The text that populates the dynamic field is pulled from a txt file using

```auto

myData = new LoadVars();
myData.onLoad = function() {
myText_txt.text = this.myVariable;
};
myData.load("myText.txt");

```

So i’ve got this code on a keyframe above the first keyframe of the text tween. WHen I test the movie the variable loads and appears but as soon as the tween hits the second keyframe it becomes undefined.  
So the var isn’t available to the text box throughout its’ tween.  
What’s the deal with this and is there a workaround?
