2 Replies Latest reply on Aug 7, 2007 5:58 PM by zoop57

    XML help

    zoop57
      Hi im new to Flex im just using it to make a app that displays all the games on my site and has links to them all from a xml file i have got it all running but i would like it to automatically arrange all the things in the xml file alphabetically is there any way of doing this via the render file or will i just have to arrange the xml file by hand

      thanks in advance, Zoop
        • 1. Re: XML help
          keith_pd
          Zoop,
          I'm new to Flex myself but you might want to check out the XMLListCollection and/or the ArrayCollection. Collections allow you to do sorting and will reflect any changes you make to the dataprovider.

          Hope this helps
          - Keith
          • 2. XML help
            zoop57 Level 1
            Thanks il have a try but if some one could give me code that is read to be adapted to my app i will be very thankful

            edit: i have had a look at the refrence thingy that adobe has and i cant make sence of how to implement any of those functions you told me

            here is the code for both the files in my project
            Game.mxml:
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="gSvr.send()">
            <mx:Panel layout="horizontal" horizontalAlign="left" id="games" width="100%" height="100%" title="games">
            <mx:TileList height="100%" width="100%" id="ls" dataProvider="{gSrv.lastResult.games.game}" itemRenderer="render" ></mx:TileList>
            </mx:Panel>
            <mx:HTTPService id="gSrv" url="games.xml"/> <mx:HTTPService/>


            </mx:Application>

            render.mxml:
            <?xml version="1.0"?>
            <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml"
            horizontalAlign="center"
            verticalGap="0" borderStyle="none">

            <mx:Image id="image" width="70" height="60" source="pictures/{data.image}"/>
            <mx:LinkButton width="120" label="{data.name}"
            click="navigateToURL(new URLRequest('game_pages/{data.link}.html'),
            '_blank')"
            />
            </mx:VBox>