0
我想從PHP獲取一些用戶數據到AS3。AS3獲得變數,但無法訪問
當我在AS3執行我的代碼,我得到這個:&levelUser=5&livesUser=5
並以其良好,這就是我想要的轉移
但是,當我試圖讓只有一個變量我得到這個錯誤的數據:
ReferenceError: Error #1069: Property livesUser not found on String and there is no default value.
at petRush_fla::MainTimeline/serverResponse()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
而且我不知道是誰發生這種情況,我離開了我的代碼在這裏:
function conectToServer() {
//Conectamos al servidor
loadingNum.text = "Connection to server...";
var zahtjev:URLRequest=new URLRequest("getUserInfo.php");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, serverResponse);
loader.load(zahtjev);
}
var livesVar:String;
function serverResponse(e:Event):void {
trace(e.target.data.livesUser);
gotoAndStop(2);
}