sure..please see attached.

Kshama

On Mon, May 11, 2009 at 1:55 AM, Ravi Mishra <[email protected]> wrote:

>
> Kshama,
>
> Can you plz send the format of the XML you are trying to parse?
>
> -Ravi
>
> On May 10, 9:56 pm, "[email protected]" <[email protected]>
> wrote:
> > Hi there,
> > In my application, I have TileList with a image and label in each
> > tile. The image and label is retrieved from a xml file.However, when I
> > run the project it fails and points to default FaultHandler function.
> >
> > On further debugging, I realized that length of XML data returned from
> > HTTPService is 0. So the httpservice is unable to hit the xml
> > file..right ?
> >
> > here is the code:
> >
> > <mx:Script>
> >
> >          <![CDATA[
> >                 import mx.collections.ArrayCollection;
> >               import mx.collections.XMLListCollection;
> >                 import mx.rpc.events.ResultEvent;
> >                 [Bindable]
> >                 private var itemlist :XMLList;
> >                 private var itemlistcoll : XMLListCollection
> >               private function xmlLoaded(evt:ResultEvent):void {
> >                     itemlist = evt.result.catalog;
> >                    trace( itemlist.length());
> >
> >                     }
> >            ]]>
> >
> >      </mx:Script>
> >     <mx:HTTPService id = "srv" url="data/catalog.xml" useProxy="false"
> > result="xmlLoaded(event)"  resultFormat="e4x" />
> >
> > Can you please throw some light on what must have gone wrong.
> >
> > Also, if the  dataprovider for TileList is  srv.LastResult.catalog, it
> > seems to load the label but not image ( image is replaced by a small
> > cross ).
> >
> > Thanks,
> > Kshama
> >
> > ---------- Forwarded message ----------
> > From: "[email protected]" <[email protected]>
> > Date: May 10, 4:56 am
> > Subject: fault event occurs on httpservice call
> > To: Flex India Community
> >
> > Hello,
> >
> > In my application, I have TileList with a image and label in each
> > tile. The image and label is retrieved from a xml file.
> >
> > I  use  :
> >       <mx:HTTPService id = "srv" url="data/catalog.xml"
> > useProxy="false" result="itemhandler(event)" resultFormat="e4x"  />
> >
> > to load the xml file.
> >
> > However, when I run the project it fails and points to default
> > FaultHandler function. But, if I alter the url  or change the location
> > of xml file, then too it fails, but it indicates that error is in
> > itemHandler. I am unable to understand why this is happening.
> >
> > is something wrong in url . Here is rough sketch of my folder
> > structure:
> >  /src
> >        /data
> >             -catalog.xml
> >       /components
> >            - shop.xml
> >            -itemview.xml
> >      /images
> >            -image1.jpg
> >
> > (Note : I have also tried using src/data/catalog.xml as url)
> >
> > I wasnt getting the error earlier, when most of object declaration was
> > in the main application. I restructured my project, to  keep it more
> > organized and then the error start occurring.
> >
> > Here is the code :
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="932"
> > height="400"   creationComplete="srv.send()">
> >         <mx:Script>
> >          <![CDATA[
> >                 import mx.rpc.events.ResultEvent;
> >               import mx.collections.XMLListCollection;
> >
> >               [Bindable]
> >                public var itemlist : XMLListCollection;
> >
> >                private function itemhandler(evt:ResultEvent):void
> >                {
> >                    itemlist = evt.result..item;
> >                    trace(itemlist)
> >                }
> >
> >          ]]>
> >
> >      </mx:Script>
> >     <mx:HTTPService id = "srv" url="../data/catalog.xml"
> > useProxy="false" result="itemhandler(event)" resultFormat="e4x"  />
> >
> >      <mx:Model id="catalog"   />
> >
> >    <!-- Using inline item renderer -->
> >
> >    <mx:TileList id="ItemDisplay" rowCount="3" columnCount="3"
> > rowHeight="150"  columnWidth="150" dataProvider="{itemlist}"
> > width="100%" height="97%" y="0" x="0"   verticalScrollPolicy="auto"
> > visible="true">
> >           <mx:itemRenderer>
> >                 <mx:Component >
> >                          <mx:VBox  width="50" height="50"
> > horizontalAlign="center" clipContent="false" verticalAlign="middle" >
> >                                 <mx:Image source="{'images/'+
> > data.image}"  height="100" width="100" />
> >                                 <mx:Label text="{data.name}"
> > textDecoration="underline" fontStyle="italic" fontThickness="11"
> > fontWeight="bold"/>
> >                         </mx:VBox>
> >                  </mx:Component>
> >       </mx:itemRenderer>
> >
> >    </mx:TileList>
> > </mx:Canvas>
> >
> > Please advise.
> >
> > Kshama
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

<?xml version="1.0" encoding="utf-8"?>

<catalog>

    <item itemId="1">
        <name>mug_1</name>
        <description>Borland cofee mug 1</description>
        <price>3</price>
        <image>mug_1.jpg</image>
        <category>Cofeemugs</category>
        <color>white</color>        
    </item>

    
    <item itemId="2">
        <name>mug_2</name>
        <description>Borland cofee mug 2</description>
        <price>3</price>
        <image>mug_2.jpg</image>
        <category>Cofeemugs</category>
        <color>black</color>        
    </item>

    <item itemId="3">
        <name>mug_3</name>
        <description>Borland cofee mug 3</description>
        <price>3</price>
        <image>mug_3.jpg</image>
        <category>Cofeemugs</category>
        <color>Red</color>        
    </item>
     
     <item itemId="4">
        <name>off_supply3</name>
        <description>Scratch Pad</description>
        <price>3</price>
        <image>off_supply3.jpg</image>
        <category>Office Supplies</category>
        <color>Red</color>        
    </item>
    
    <item itemId="5">
        <name>off_supply1</name>
        <description>Glowing Clips</description>
        <price>3</price>
        <image>off_supply1.gif</image>
        <category>Office Supplies</category>
        <color>Yellow</color>        
    </item>
    
     <item itemId="6">
        <name>off_supply2</name>
        <description>Glowing Clips</description>
        <price>3</price>
        <image>off_supply2.jpg</image>
        <category>Office Supplies</category>
        <color>Yellow</color>        
    </item>
    
    
     <item itemId="7">
        <name>off_supply1</name>
        <description>Glowing Clips</description>
        <price>3</price>
        <image>off_supply1.jpg</image>
        <category>Office Supplies</category>
        <color>Yellow</color>        
    </item>
    
    <item itemId="8">
        <name>T-Shirt</name>
        <description>Graphic Tee</description>
        <price>7</price>
        <image>tshirt_1.jpg</image>
        <category>Casual Wear</category>
        <color>Yellow</color>        
    </item>
    
     <item itemId="9">
        <name>T-Shirt2</name>
        <description>Spring Collection</description>
        <price>6</price>
        <image>tshirt_2.jpg</image>
        <category>Casual Wear</category>
        <color>Blue</color>        
    </item>  
  
</catalog>

Reply via email to