3 Replies Latest reply on Mar 19, 2008 1:36 AM by s.lanton

    Can't get adobe example to work

      At http://www.adobe.com/devnet/flex/quickstart/using_data_providers/#external there is an example of using an HTTPService control to read in an XML file and then uses the read-in data as the data provider for a List control.
      but I can't get it to work. The only thing I have changed is the httpservice url from
      url="data/bloggers.xml" to
      url=" http://www.mysite.com/bloggers.xml but every time I try to run the application I get an error message. The problem is related to the binding because if I take out the code ... dataProvider="{bloggersCol}" on the list component the application will run but obviously not as intended. Can any one see what the problem is?
      The xml is

      <name>Andy Budd</name>
      <url> http://andybudd.com</url>

      <name>Grant Skinner</name>
      <url> http://gskinner.com</url>

      <name>Paul Booth</name>
      <url> http://paulbooth.com</url>
      and the application code is

      <?xml version="1.0" encoding="utf-8"?>
      xmlns:mx=" http://www.adobe.com/2006/mxml"

      width="350" height="220"

      import mx.managers.CursorManager;
      import mx.rpc.events.InvokeEvent;
      import mx.controls.Alert;
      import mx.rpc.events.FaultEvent;
      import mx.rpc.events.ResultEvent;
      import mx.collections.ArrayCollection;


      private var bloggersCol:ArrayCollection;

      // Gets called when HTTPService is invoked to
      // request the XML.
      private function bsInvokeHandler(event:InvokeEvent):void

      // Display the busy cursor

      // Gets called when the XML is successfully loaded.
      private function bsResultHandler(event:ResultEvent):void

      // Save a reference to the list of bloggers
      bloggersCol = event.result.bloggers.blogger;

      // Hide the busy cursor

      private function bsFaultHandler(event:FaultEvent):void

      // There was an error in loading the XML
      Alert.show (event.fault.message);

      // Hide the busy cursor


      <!-- Service to load in XML -->



      <mx:Panel title="Bloggers we love!" width="100%">

      id="bloggersList" width="100%" rowCount="4"


      <mx:ControlBar horizontalAlign="center">

      label="Add a blogger!"
      click="bloggersCol.addItem({name:'Pete-Barr Watson', url:' http://petebarrwatson.com/'});"