开发者

onResult HTTPService

I have a HTTPService:

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

And a script for (event):

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

The problem is that none of开发者_Go百科 the event possibilities fires after I POST data to my php...

Thanks, Yan


There isn't a real URL attribute in the HTTPService -- but I don't know if you edited it out or not. Try adding this to the HTTPService tag:

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

You should always have a fault handler too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜