onResult HTTPService

时间:2010-09-01 13:44:31

标签: flex actionscript-3 events httpservice actionresult

我有一个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("...", "...");
        }
    }

问题是在我将数据发布到我的php后,没有任何事件可能性发生......

谢谢,Yan

1 个答案:

答案 0 :(得分:2)

HTTPService中没有真正的URL属性 - 但我不知道你是否编辑过它。尝试将此添加到HTTPService标记:

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

你也应该总是有一个错误处理程序。