# Trouble accesing data using LoadVars()

**URL:** https://forum.kirupa.com/t/trouble-accesing-data-using-loadvars/84753
**Category:** flash
**Created:** [March 30, 2005, 9:01am UTC](https://forum.kirupa.com/t/trouble-accesing-data-using-loadvars/84753 "2005-03-30T09:01:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![renikm](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@renikm](https://forum.kirupa.com/u/renikm)
#### Post date: [March 30, 2005, 9:01am UTC](https://forum.kirupa.com/t/trouble-accesing-data-using-loadvars/84753/1 "2005-03-30T09:01:42Z")

</div>

Hello all,

I’m having so much trouble using laodVars() even after reading the tutorial on this site and others as well. All i want to do is store some variables in a text file instead of having it hardcoded. I’ve tried variations of using loadVar(). It seems to load the variables but i can’t access them.  
The code i have is:

```auto
data = new loadVars();
data.load("themes/color.txt")
data.onLoad = function( success ){
     if(success){
 		trace("variables loaded");
		trace(data.color1);
		trace(data.color2);
		trace(data.color3);
      } else {
        trace("Error loading page");
     } 

```

And in color.txt are different colors like:

color1=0x99FF99&color2=0xFF99FF&color3=0xAA99FF

So the hex colors are stored in the txt file and i would like to load them into variables so i can use them in flash. The trace in the above code is undefined…

Any ideas? thanks in advance!
