0 Replies Latest reply on Sep 21, 2007 1:23 AM by

    Error in an image gallery with XML and Flex2

      Hi all, i've made a state where i want a imggallery to be, here is the code i've used:
      in Application i've added:

      creationComplete="imagesIn.send()" xmlns:cmp="*"

      and an mx:script:
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;

      [Bindable]
      public var imagesArr:ArrayCollection;

      [Bindable]
      public var selectImages:Object;

      public function retrieveDataHandler(event:ResultEvent):void {

      imagesArr = event.result.listImages.images;

      }
      ]]>
      </mx:Script>

      added a HTTPservice:

      <mx:HTTPService id="imagesIn" url="XML/imageList.xml" result="retrieveDataHandler(event)"/>

      in the Panel in the gallery state i added a VBox and a tilelist:

      <mx:VBox x="38" y="316" height="100%" id="boxImage">
      <mx:TileList dataProvider="{imagesArr}" id="thumb" itemRenderer="ShowImage"
      columnWidth="110"
      borderThickness="0"
      backgroundAlpha="0"
      paddingTop="10"
      paddingBottom="10" width="525"/>
      </mx:VBox>

      In the XML there are the links to the imageshack images i want to show.

      Now, when i run the project, it doesn't give me any error during the compiling, but when the project starts:

      "[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: file:///Users/kimeraStudio/Documents/Flex Builder 2/Prova/bin/XML/imageList.xml"]. URL: XML/imageList.xml"]
      at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at private::DirectHTTPMessageResponder/errorHandler()
      at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
      at [io]"

      The XML file is located inside an "XML" folder inside the root of the project.

      I've also made a ImageRenderer in an external MXML file:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Image xmlns:mx=" http://www.adobe.com/2006/mxml">

      </mx:Image>


      What happened? Why it doesn't work?

      Sorry for bothering you but it's important and i'm still a n00b with Flex!
      (PS: sorry also for the bad english but i'm italian :P )

      Thanks!