# Loading data into variables

**URL:** https://forum.kirupa.com/t/loading-data-into-variables/62375
**Category:** flash
**Created:** [August 27, 2004, 9:06am UTC](https://forum.kirupa.com/t/loading-data-into-variables/62375 "2004-08-27T09:06:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Hiro](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Hiro](https://forum.kirupa.com/u/Hiro)
#### Post date: [August 27, 2004, 9:06am UTC](https://forum.kirupa.com/t/loading-data-into-variables/62375/1 "2004-08-27T09:06:58Z")

</div>

Hi all,

I am trying to load data into a variable. This part works fine

```auto
 
 loadText = new loadVars();
 loadText.load("htmltextFile.txt");

  loadText.onLoad = function(success) 
  {
   if (success) {

			  tb1.htmlText = this.content;
		 }
   else{   
			  tb1.htmlText= "Online Content Unavailable, Loading Offline Version";
   }
 

```

This works fine and it loads it into the text field tb1.

However if i change this to

var var1 = this.content

then at a later stage do

tb1.htmlText = var1

this doesnt work :(…

Any idea?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 27, 2004, 3:13pm UTC](https://forum.kirupa.com/t/loading-data-into-variables/62375/2 "2004-08-27T15:13:23Z")

</div>

Also actually it works if i set a variable to something like

var var1 = “Hello”;

The problem comes when i try set

var var1 = this.content

why would this be?
