<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:controls="com.renaun.controls.*"
    width="100%" height="100%"
    minWidth="640" minHeight="460"
    
    creationComplete="rssService.send()"
    
    layout="absolute" viewSourceURL="srcview/index.html">
    
    <!-- CSS include -->
    <mx:Style source="assets/css/main.css" />

    <mx:HTTPService 
        id="rssService" 
        url="../api/getFeed/outputType/xml"
        result="resultHandler(event)"
        showBusyCursor="true" 
        resultFormat="e4x" />
    <!--
    The ECMAScript for XML specification defines a set of 
    classes and functionality for working with XML data. 
    These classes and functionality are known 
    collectively as E4X. ActionScript 3.0 includes 
    the following E4X classes: XML, XMLList, QName, and Namespace.

    The methods, properties, and operators of the E4X classes 
    are designed with the following goals:

    * Simplicity - Where possible, E4X makes it easier to 
        write and understand code for working with XML data.
    * Consistency - The methods and reasoning behind E4X are 
        internally consistent and consistent with other parts of ActionScript.
    * Familiarity - You manipulate XML data with well-known 
        operators, such as the dot (.) operator.
    -->
    
    <mx:Script>
        <![CDATA[
            import mx.collections.XMLListCollection;
            import mx.rpc.events.ResultEvent;
            
            [Bindable]
            private var articles:XMLListCollection;
            
            private function resultHandler(event:ResultEvent):void
            {
                var result:XMLList = event.result.entry.entry;
                articles = new XMLListCollection(result);
            }
        ]]>
    </mx:Script>
    
    <controls:RSSPictureBook
        content="{articles}" />
    
    <mx:Label
        text="Zend Feed Book"
        styleName="bookTitle"
        horizontalCenter="0"
        verticalCenter="220" />
    
</mx:Application>