1 Reply Latest reply on Sep 15, 2006 5:11 PM by ntsiii

    Looping XML from HTTPService with mx:Repeater

    webSlinger Level 1
      This is pretty much the same as Topic Title Repeater with XML

      But, even when following this discussion, I still get the "Access of possibly undefined property" error messages for the nodes I am trying to reference.

      MY FLEX CODE
      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="absolute"
      creationComplete="feedRequest.send()" width="449" height="488" color="#000040" fontSize="16">

      <mx:HTTPService
      id="feedRequest"
      url=" http://www.mysite.com/rss/feed.cfm?feed=7"
      useProxy="false"
      resultFormat="e4x" />

      <mx:Model id="myfeed" source="{feedRequest.rss.channel}"/>
      <mx:ArrayCollection id="feed" source="mx.utils.ArrayUtil.toArray(myfeed)"/>



      <mx:Panel width="439" height="443" layout="absolute" title="{feedRequest.lastResult.rss.channel.title}" cornerRadius="20" backgroundAlpha="1.0" alpha="1.0" y="40" x="5" borderStyle="solid">
      <mx:Text x="7" y="-4" text="Latest Posting Dynamic Call" fontSize="11"/>
      <mx:Repeater id="i" dataProvider="{myfeed}">
      <mx:Image x="10" y="23" scaleContent="true" autoLoad="true" width="52" height="52" source="{i.currentItem.media.avatar}"></mx:Image>
      <mx:Text x="70" y="22" text="{i.currentItem.title}" width="339" fontSize="12" fontWeight="bold" height="28"/>
      <mx:Text x="231" y="38" text="by {i.currentItem.author}" fontSize="10" color="#c0c0c0" width="98" height="15"/>
      <mx:Text x="70" y="38" text="{i.currentItem.pubDate}" fontSize="10" width="157" color="#c0c0c0" height="15"/>
      <mx:Text x="70" y="52" text="{i.currentItem.description}" width="326" height="54" enabled="true" fontSize="10"/>
      </mx:Repeater>
      </mx:Panel>
      </mx:Application>



      MY XML RETURNED

      quote:


      <?xml version="1.0" encoding="UTF-8"?>
      <rss>
      <channel>
      <title>mysite.com - Journal</title>
      <link> http://www.mysite.com/index.cfm/mysite/backstage.artistpass/ID/7/view.htm</link>
      <description>Official mysite.com Journal</description>
      <pubDate>Wed, 13 Sep 2006 08:29 AM</pubDate>
      <lastBuildDate>{ts '2006-09-13 08:29:35'}</lastBuildDate>
      <generator> http://www.mysite.com/</generator>
      <item>
      <title>Beautiful Montana</title>
      <pubDate>Posted 0 Days 14 Hours 12 Minutes ago</pubDate>
      <link> http://www.mysite.com/index.cfm/mysite/Pictures.view/searchText/Beautiful%FE%FF%00%20Monta na/ID/156/view.htm</link>
      <description>The weather could not be anymore perfect today.</description>
      <author>Paul</author>
      <media>
      <avatar> http://www.mysite.com/images/users/Avatars/D5198FBB.jpg</avatar>
      <image>
      <fullsize> http://mysite.com/images/wm/image.cfm?image=/content/20060912-3360-4F9A2EB5.JPG</fullsize>
      <thumbnail> http://mysite.com/images/wm/image.cfm?image=/content/20060912-3360-4F9A2EB5.JPG&amp;width= 256</thumbnail>
      </image>
      </media>
      <Subject>Beautiful Montana</Subject>
      <body>
      <p>The weather could not be anymore perfect today.<br/>
      <a href=" http://mysite.com/index.cfm/mysite/pictures.view/searchText/View%20Beautiful%FE%FF%00%20Mo ntana/id/187/view_187.htm"><img src=" http://mysite.com/images/i/image.cfm?image=/content/20060912-3360-4F9A2EB5.JPG&amp;width=2 56" width="256"/></a>
      </p>
      </body>
      <tags/>
      </item>
      <item>
      <title>The latest in Merchandising..</title>
      <pubDate>Posted 0 Days 15 Hours 2 Minutes ago</pubDate>
      <link> http://www.mysite.com/index.cfm/mysite/Pictures.view/searchText/The%FE%FF%00%20latest%00%2 0in%00%20Merchandising%00%2E%00%2E/ID/155/Silverstein_backstage.htm</link>
      <description>text text text text text text text text text text text text text text text text text text text </description>
      <author>Paul</author>
      <media>
      <avatar> http://www.mysite.com/images/users/Avatars/D5198FBB.jpg</avatar>
      <image>
      <fullsize> http://mysite.com/images/wm/image.cfm?image=/content/20060912-2388-532B7287.JPG</fullsize>
      <thumbnail> http://mysite.com/images/wm/image.cfm?image=/content/20060912-2388-532B7287.JPG&amp;width= 256</thumbnail>
      </image>
      </media>
      <Subject>The latest in Merchandising..</Subject>
      <body>
      <p>We would had a great day yesterday (as documented in yesterday's blog
      entries). Please see the attached poster that has been constructed in
      less than 24 hours. We made a limited run of 100 posters that are all
      being hand numbered. Get them while supplies last!<br/>
      <a href=" http://mysite.com/index.cfm/mysite/pictures.view/searchText/View%20Beautiful%FE%FF%00%20Mo ntana/id/186/view_186.htm"><img src=" http://mysite.com/images/i/image.cfm?image=/content/20060912-2388-532B7287.JPG&amp;width=2 56" width="256"/></a>
      </p>
      </body>
      <tags>under 21 Audition</tags>
      </item>
      </channel>
      </rss>



      Thanks sooo much for your help... Ive been racking my brain on this reading over and over everything always ending up at the same spot.