Topic: how can i save my information into a variable from webserver!!!
class A
{
var data:String;
public function A(path)
{
var host = this;
var receiver:LoadVars = new LoadVars();
var sender:LoadVars = new LoadVars();
sender.sendAndLoad(path, receiver, "POST");
receiver.onData = function(src:String)
{
host.setData(src);
};
receiver.onLoad = function(success:Boolean)
{
.............
};
}
public function setData(src:String)
{
this.data = src;
}
public function getData(void):String
{
return this.data;
}
}
import A;
class B
{
static var b:B;
var a:A;
public function B()
{
this.a = new A(path);
this.a.getData(); undefined
}
static function main(mc)
{
b = new B();
}
}
in new class B this.a.getData() is undefined, i think data was not saved into the variable data inside class A, how can i detect that data loading is finished and when i have to save data, do you have any idea guys, please reply me thankssssssssss