2010-09-01 70 views
2

我有一個的HTTPService:onResult的HTTPService

<mx:HTTPService id="scoreService" url="http://" method="POST" result="onResult(event)"> 
     <s:request xmlns=""> 
      <name>{..}</name> 
      <score>{...}</score> 
     </s:request> 
    </mx:HTTPService> 

而對(事件)的腳本:

private function onResult(e:ResultEvent):void 
    { 
     if (e.result.status == true) 
     { 
      currentState='...'; 
     } 
     else 
     { 
      Alert.show("...", "..."); 
     } 
    } 

的問題是,沒有一個事件可能觸發的我POST數據到我的PHP之後。 ..

感謝,顏

+0

代碼是否碰到onResult()?如果是這樣 - 結果的價值是什麼? – 2010-09-01 13:47:02

+1

「默認解碼器無法解碼結果」 – Yan 2010-09-01 15:57:42

回答

2

沒有在的HTTPService一個真正的URL屬性 - 但我不知道喲你編輯它或不。嘗試將此添加到HTTPService標記:

fault="mx.controls.Alert.show(event.fault.faultString)" 

您應該始終有一個錯誤處理程序。

+0

「默認解碼器無法解碼結果」 – Yan 2010-09-01 15:54:26

+0

解決方案是什麼?是它的網址? – adamcodes 2010-09-02 20:55:25