开发者

Parsing an XML response on AS3

i have this response from a socket server:

[DataEvent type="data" bubbles=false cancelable=false eventPhase=2 data="Segunda vez"]

开发者_StackOverflow中文版

How can i parse this info?, for example if i want the data value.


set an event listener on the object that is dispatching the event:

myDispatcher.addEventListener("data", dataEventHandler);
//would be better to have a constant.  perhaps DataEvent.DATA is the constant?

then call the data in the event handler:

function dataEventHandler(evt:DataEvent):void
     {
     trace(evt.data) //Segunda vez
     }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜