# Help with the loadvars class

**URL:** https://forum.kirupa.com/t/help-with-the-loadvars-class/192363
**Category:** Uncategorized
**Created:** [June 28, 2006, 3:05am UTC](https://forum.kirupa.com/t/help-with-the-loadvars-class/192363 "2006-06-28T03:05:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pixeldude](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pixeldude](https://forum.kirupa.com/u/pixeldude)
#### Post date: [June 28, 2006, 3:05am UTC](https://forum.kirupa.com/t/help-with-the-loadvars-class/192363/1 "2006-06-28T03:05:27Z")

</div>

Hi…everyone…

After I’ve been get fiddling and searching in this forum for the solution I decide to ask in forum…Okay my problem is I cannot display my data in my textfield eventhough I have successfull load my data from the php page…OR!!..there is another terms or something stuff I might missing in my class…sorry for my novice…the reasons I using the class is I’ll reuse this loadvars for my application…so instead I write the same code for many times…it’s better for me using the class…

so here are the class file Loaddata.as

```auto

class Loaddata{
	//class property
	private var myData:LoadVars;
	private var someString:String;
	
	//constructor
	function Loaddata(someString){
		this.someString = someString;
	}
	
	//methods
	function getData(){
		this.myData = new LoadVars();
		myData.load(someString);
		myData.onLoad = function(success:Boolean){
            if(success){   
			   trace(this.thedata);
            }else{
				trace("error parsing record");
			}
		}
	}
}

```

and here are my fla file

```auto

stop();

loadBtn.onPress = function(){
   someString = "http://localhost/flashthingy/thedata.php?a=" + random(999999); 
   var mydata = new Loaddata(someString); 
   mydata.getData();//output-->it will trace the data perfectly

   //myTextField.text = ;//-->this portion I didn't know how to get the data from the php page...
}

```

here’s are the php stuff

```php

$thedata = "this is just a testing loading data ";

echo "&thedata=".urlencode($thedata);

```

I think that;s all…hope someone will show me or at least point me where is my mistake…since it’s good for me as a OOP newbie to learning from the mistake…Thank you again
