tags:

views:

30

answers:

1

Hi,

I've followed the Flex in a week example, with the drop down menu that pairs the XML data to the XML node set.

For the project I am creating, I am just pulling through ONE XML file containing just one node into my application.

So my question is, How do I achieve this?

I am using HTTPService and pulling the data through, but at present the only way for this to work is by using the <s:DropDownList>

My code is as follows :

 <fx:Declarations>
  <!-- Place non-visual elements (e.g., services, value objects) here -->

  <s:HTTPService id="channelList" 
        url="http://www.spriing.dev/videolist/createxml.php" 
        showBusyCursor="true">
  </s:HTTPService>

 </fx:Declarations>
  <s:Group>
   <mx:Image id="backgroundImg" source="{channelSelection.selectedItem.background_image}" width="100%" height="100%" scaleContent="true"/>
  </s:Group>

  <s:Group>
   <mx:FormItem label="Select Your Channel : ">

    <s:DropDownList id="channelSelection" dataProvider="{channelList.lastResult.channels.channel}" labelField="name"  width="196"/>

   </mx:FormItem>

   <s:Label text="{channelSelection.selectedItem.name}"  x="0" y="45" width="331"/>

   <s:Label text="{channelSelection.selectedItem.description}"  x="0" y="72" width="331"/>

   <mx:Image source="{channelSelection.selectedItem.logo}" x="2" y="95" />

</s:Group>

Many Thanks in advance..

+1  A: 

Bind them to the original source (the HTTPService) by replacing channelSelection.selectedItem with channelList.lastResult.channels.channel

<s:Group>
    <mx:Image id="backgroundImg" width="100%" height="100%" scaleContent="true"
       source="channelList.lastResult.channels.channel.background_image}" />
</s:Group>
<s:Group>

    <s:Label text="{channelList.lastResult.channels.channel.name}"  
        x="0" y="45" width="331"/>

    <s:Label text="{channelList.lastResult.channels.channel.description}"  
        x="0" y="72" width="331"/>

    <mx:Image source="{channelList.lastResult.channels.channel.logo}" x="2" y="95" />

</s:Group>
Amarghosh
Jackpot... Thanks
StuBlackett
@Amarghosh - How do I go about selecting ALL the data from the XML now? Basically I'm doing an IPTV service. The first one just pulls through the ONE channel as you've advised me on.But there are videos within that channel, How can I pull them ALL through?Thanks in advance
StuBlackett
I think you're looking for datagrid, tile list or a simple list with proper item renderers. Post this as a new question; don't forget to add the structure of xml.
Amarghosh