I am trying to get this TileList to display my data from an
HTTPService, however, in the itemRenderer(Thumbnail), Flex will
display my data when I code my image source as "{data.image}", but I
want to know how does flexstore code it as "{product.image}" and their
data gets displayed?  I tried following their structure, but got lost
somewhere.  Can anybody help?  Here is how I coded my App:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" xmlns="*" creationComplete="initApp()">
        
<mx:Script>
<![CDATA[
        import mx.collections.ArrayCollection;
        import mx.rpc.events.ResultEvent;
                        
        [Bindable]
        public var catalog:ArrayCollection;
                        
        public function initApp():void{
                srv.send();
        }
        public function resultHandler(event:ResultEvent):void{
                catalog = event.result.catalog.product;
        }
]]>
</mx:Script>
        
<mx:HTTPService id="srv" url="data/catalog.xml" useProxy="false" 
        result="resultHandler(event)"/>
                
<mx:Canvas x="0" y="0" width="100%" height="100%">

<mx:HBox width="100%" height="100%">
        <Cart id="cartPanel" width="30%" height="100%"/>
        <CatalogPanel id="catalogPanel" width="70%" height="100%"
catalog="{catalog}"/>
</mx:HBox>
</mx:Canvas>

</mx:Application>


<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
xmlns="*">
        
<mx:Script>
<![CDATA[
        import mx.collections.ArrayCollection;
                        
        [Bindable]
        public var catalog:ArrayCollection = new ArrayCollection();
]]>
</mx:Script>
        
<mx:TileList dataProvider="{catalog}" height="100%" width="100%" 
        itemRenderer="Thumbnail" id="productTileList" rowCount="3"
columnCount="4"/>
                
</mx:Panel>


<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml";>
<mx:Script>
<![CDATA[
        import mx.events.*;
        import mx.core.*;
        [Bindable]
        public var product:Object;
]]>
</mx:Script>

<mx:VBox x="0" y="0" width="100%" height="100%"
horizontalAlign="center" verticalAlign="middle">

<mx:Image width="85" height="85" verticalAlign="middle"
horizontalAlign="center" source="{product.image}" id="image"
useHandCursor="true"/>

<mx:Label text="{product.name}" fontSize="10" fontFamily="Arial"/>
</mx:VBox>

</mx:Canvas>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to