4 Replies Latest reply on Feb 9, 2009 8:53 AM by joemacdoakes

    More fun with Flex

    joemacdoakes
      As usual, something's not working for me and I can't find the answer. And I'm just on the third lesson. Attached is the code. what'd i miss?
        • 1. Re: More fun with Flex
          Level 7
          For one thing, you have declared the same variable twice:

          private var roomList:ArrayCollection
          =20
          [Bindable] private var roomList:ArrayCollection;


          and there is no ; at the end of the first statement.

          --=20
          Nancy Gill
          Adobe Community Expert
          Author: Dreamweaver 8 e-book for the DMX Zone
          Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
          Technical Editor: Dreamweaver CS3: The Missing Manual,
          DMX 2004: The Complete Reference, DMX 2004: A Beginner's Guide
          Mastering Macromedia Contribute
          Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web =
          Development

          "joemacdoakes" <webforumsuser@macromedia.com> wrote in message =
          news:gmabq9$q9q$1@forums.macromedia.com...
          > As usual, something's not working for me and I can't find the answer. =
          And I'm=20
          > just on the third lesson. Attached is the code. what'd i miss?
          >=20
          > <?xml version=3D"1.0" encoding=3D"utf-8"?>
          > <mx:Application xmlns:mx=3D" http://www.adobe.com/2006/mxml"=20
          > layout=3D"absolute" backgroundColor=3D"#FFFFFF"=20
          > creationComplete =3D "init()">
          > =20
          > =20
          > =20
          > <mx:Script>
          > <![CDATA[
          > import mx.events.ListEvent;
          > =20
          > import mx.collections.ArrayCollection;
          > =20
          > import mx.rpc.events.FaultEvent;
          > =20
          > import mx.controls.Alert;
          > =20
          > private var roomList:ArrayCollection
          > =20
          > [Bindable] private var roomList:ArrayCollection;
          > =20
          > private function changeHandler(event:ListEvent):void{
          > =20
          > }
          > private function init():void{
          > rooms.send();
          > }
          > =20
          > private function httpFaultHandler (event:FaultEvent):void{
          > Alert.show ("There was a problem", "Error");
          > }
          > =20
          > =20
          > ]]>
          > </mx:Script>
          > =20
          > <mx:HTTPService id =3D "rooms" url=3D"assets/roomList.xml2" fault =3D =

          > "httpFaultHandler(event)" />
          > =20
          > =20
          > <mx:String>Colorado Room</mx:String>
          > <mx:String>Denver Room</mx:String>
          > <mx:String>Mile High Room</mx:String>
          > <mx:String>Greeley Room</mx:String>
          > =20
          >=20
          >=20
          > <mx:Label text=3D"Kulp Convention Center"=20
          > x=3D"10" y=3D"10"=20
          > fontSize=3D"21" fontWeight=3D"bold"/>
          > <mx:Text x=3D"10" y=3D"41"=20
          > text=3D"111 49th Ave, Denver, CO 80634"/>
          > <mx:Text text=3D"Phone: 303-555-1212" x=3D"208" y=3D"41"/>
          > <mx:Text text=3D"Fax: 303-555-1234" x=3D"345" y=3D"41"/>=20
          > <mx:Label text=3D"Room Reservation System"=20
          > fontWeight=3D"bold" fontSize=3D"14"=20
          > x=3D"10" y=3D"72"/>=20
          > <mx:Label text=3D"Room Available:" x=3D"10" y=3D"108"/>
          > <mx:List id=3D"dg" x=3D"10" y=3D"134" width=3D"250"=20
          > dataProvider=3D"{roomList}"=20
          > itemClick=3D"changeHandler(event)"/>
          >=20
          >=20
          > </mx:Application>
          >
          • 2. Re: More fun with Flex
            joemacdoakes Level 1
            Thank you. Not being from the coder world, a lot of this stuff might as well be in arabic. Make it look nice is the planet I inhabit. Even when the debugger points to an error and gives me a clue, I'm in trouble. In this instance;
            1151: A conflict exists with definition roomList in namespace internal.
            IS arabic. Thanks again.
            SK
            • 3. Re: More fun with Flex
              Garyl Woolworth Level 1
              Quick question, on your HTTPService it looks like your trying to parse data from "url="assets/roomList.xml2"" is that really the filename your trying to parse or should it be url="assets/roomList2.xml"
              • 4. Re: More fun with Flex
                joemacdoakes Level 1
                Actually, the "2" is a deliberate error so that an error box will pop up. And it did. But I had to think about that for a few minutes since the instructions didn't quite set up the premise.
                SK