Using actionscript3 Syntax Highlighting
public function getTicketFromPhp():void
{
//_Main.loading_mc.visible = true;
winPrice = 0
/// ***************** neeed make security check ***************************
var myData:URLRequest = new URLRequest('http://4zz.2a.2zz.cc/getTickReal.php');
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.getData = "test";//String(_Main.theClub);
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, onGetTicketComplete);
loader.load(myData);
// לתפוס ERROR
}
private function onGetTicketComplete(e:Event):void
{
var datA:* = e.target.data;
winPrice = Number(datA["win"]); /// can be used in the class that call it after event is listend
//idOfUser = String(datA["id"]);
//coinsOfUser = int(datA["coins"]);
//trace("id of user = " +idOfUser);
//trace("coins of user = "+coinsOfUser);
//trace ("win price == " + winPrice);
dispatchEvent(new Event("dataLoad"));
}
{
//_Main.loading_mc.visible = true;
winPrice = 0
/// ***************** neeed make security check ***************************
var myData:URLRequest = new URLRequest('http://4zz.2a.2zz.cc/getTickReal.php');
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.getData = "test";//String(_Main.theClub);
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, onGetTicketComplete);
loader.load(myData);
// לתפוס ERROR
}
private function onGetTicketComplete(e:Event):void
{
var datA:* = e.target.data;
winPrice = Number(datA["win"]); /// can be used in the class that call it after event is listend
//idOfUser = String(datA["id"]);
//coinsOfUser = int(datA["coins"]);
//trace("id of user = " +idOfUser);
//trace("coins of user = "+coinsOfUser);
//trace ("win price == " + winPrice);
dispatchEvent(new Event("dataLoad"));
}
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
איך אני בודק אם יש לי ERROR כלומר לא מציחים להתחבר לשרת?
אני מאמין שבמקום COMPLETE יש לי בדיקה ל ERROR
בתודה לעונים
חדשות