# \[CS4\] LoadVars and Textarea, sporadically "undefined" URGENT

**URL:** <https://forum.kirupa.com/t/cs4-loadvars-and-textarea-sporadically-undefined-urgent/303184>\
**Category:** flash\
**Created:** [January 15, 2010, 5:16pm UTC](https://forum.kirupa.com/t/cs4-loadvars-and-textarea-sporadically-undefined-urgent/303184 "2010-01-15T17:16:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenryGale](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@HenryGale](https://forum.kirupa.com/u/HenryGale)\
**Post date:** [January 15, 2010, 5:16pm UTC](https://forum.kirupa.com/t/cs4-loadvars-and-textarea-sporadically-undefined-urgent/303184/1 "2010-01-15T17:16:59Z")

</div>

[SIZE=2]Hi, everyone;[/SIZE]

[SIZE=2]Been beating my head against this for a while now and am starting to get down to the wire. I could really urgently use a hand here and would be so appreciative of any help you can offer.[/SIZE]

[SIZE=2]I have a flash site, built in CS4 and AS2, with four textareas that are populated by a LoadVars that is pulling variables from a .txt file. These textareas are unreliable; about 50% of the time, the text displays just as I want, but about 50%, all I get is “undefined.”[/SIZE]

[SIZE=2]Here’s the relevant code, cribbed from elsewhere:[/SIZE]

```auto
 
ta_creative.setStyle("fontFamily","Verdana");
ta_creative.setStyle("fontSize","12");
ta_creative.setStyle("borderStyle", "none");
ta_creative.setStyle("color", "0x000000");
thisText = new LoadVars();
thisText.load("creative.txt");
thisText.onLoad = function(success) {
if (success) {
ta_creative.text = creative;
trace("creative done");
}
}; 
 

```

[SIZE=2]This part:[/SIZE]

```auto
 
thisText.onLoad = function(success) {
if (success) {
ta_creative.text = creative;
trace("creative done");
}

```

[SIZE=2]…is meant to populate textarea “ta\_creative” with variable “creative” ONLY once the variable is loaded, but it doesn’t seem to be working.[/SIZE]  
[SIZE=2]How can I get this to work correctly, reliably? I assume I need a better method for populating the textarea only once the variable is loaded, or refreshing the textarea.[/SIZE]

[SIZE=2]the site itself can be found at: [/SIZE]**[FONT=Times New Roman][SIZE=3][http://tinyurl.com/ydvzfv9](http://tinyurl.com/ydvzfv9) [/SIZE][/FONT]**[SIZE=2](tinyURL’d to protect search results). The boxes in question are on the four pages beneath the Information option on the navbar.[/SIZE]  
[SIZE=2]Help? :\*([/SIZE]
