开发者

Parsing an XML response on AS3

开发者 https://www.devze.com 2023-02-05 07:47 出处:网络
i have this response from a socket server: [DataEvent type=\"data\" bubbles=false cancelable=false eventPhase=2

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

精彩评论

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