I am not sure I understand “because you don't know which feed to pull at runtime”.

 

Using AS code you can change the URL of the HTTPService call and invoke send() at will.

 

If you need to keep track of which result goes with which send, you can use the ACT pattern, that allows you to set and retrieve data in an AsyncToken.

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jamie O
Sent: Monday, September 11, 2006 9:25 AM
To: [email protected]
Subject: [flexcoders] Multiple XML loads?

 

Hi all,

I'm about a week into learning Flex, liking a lot of what I'm seeing
for how things have been built. Reminds me of "waaaay back" when
Visual Basic was one of the larger tools on the market for front-end
based applications in that all the components and presentation
manipulation are right there.

I have one conceptual/programming question right now I'm struggling
with. Say in the blogreader sample app tutorial, you wanted to have
several buttons to read several different RSS or XML feeds. My
attempts using HTTPService have failed because you don't know which
feed to pull at runtime or been able to use a variable in the
HTTPService url. Other attempts have been equally unsuccessful.

Put the code from that tutorial in below for reference.
Any help thanks!

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="feedRequest.send()">
<mx:HTTPService
id="feedRequest"
url="" goes here"
useProxy="false"/>
<mx:Panel x="10" y="10" width="475" height="400" layout="absolute"
title="{feedRequest.lastResult.rss.channel.title}">
<mx:DataGrid x="20" y="20" id="dgPosts" width="400"
dataProvider="{feedRequest.lastResult.rss.channel.item}">
<mx:columns>
<mx:DataGridColumn headerText="Posts" dataField="title"/>
<mx:DataGridColumn headerText="Date" dataField="pubDate" width="150"/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea x="20" y="175" width="400" height="100"
htmlText="{dgPosts.selectedItem.description}" />
<mx:LinkButton x="20" y="283" label="Read Full Post"
click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));" />
</mx:Panel>

</mx:Application>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to