开发者

How to parse <media:content> in RSS using AS3?

Am trying to parse the RSS feed from www.ted.com/talks/rss, I can access all normal tags using E4X but I have no idea how one parses the tags!

For example the

This is my code and I can traverse easily but I want to pull the media:content tags.

    private function init(e:Event = null):void 
    {
        removeEventListener(Event.ADDED_TO_STAGE, init);
        // entry point

        var _loader:URLLoader = new URLLoader();开发者_开发知识库
        var _request:URLRequest = new URLRequest("http://www.ted.com/talks/rss");
        _loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
        _loader.addEventListener(IOErrorEvent.IO_ERROR, IOErrorHandler);
        _loader.addEventListener(Event.COMPLETE, onLoadComplete);
        _loader.load(_request);
    }

    private function onLoadComplete(e:Event):void 
    {
        var _rssXML:XMLList =  new XMLList(e.target.data);

        for (var i:int = 0; i < 50; i++ ) 
        {
            //trace(_rssXML.channel.item.link[i]);
            trace(_rssXML.channel.item[i]);
        }
    }

Any help would be appreciated.


Sounds like your using MRSS specifications. You want to look into QName to access qualifying namespaces

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/QName.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜