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
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
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
$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