Question
Problem setting different width for images using HorizontalList tag
Hi,<br />I succeeded using HorizontalList in my AdvancedDataGrid,<br /><br /> <mx:groupedColumns><br />...<br />...<br /> </mx:groupedColumns> <br /> <mx:rendererProviders> <br /> <mx:AdvancedDataGridRendererProvider <br /> dataField="Actual" <br /> renderer="ChartRenderer" <br /> columnIndex="3" <br /> /> <br /> </mx:rendererProviders> <br /><br />My Chartrenderer:<br /><br /><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" <br /> xmlns:local="*"><br /> <mx:Script><br /> <br /> import mx.collections.ArrayCollection;<br /> import mx.controls.Image;<br /> private var images:Array; <br /> private var catalog:ArrayCollection; <br /> private static var cat:Array = [<br /> "kpi_overtime_bar_10.png", "kpi_overtime_bar_20.png",<br /> "kpi_overtime_bar_30.png", "kpi_overtime_bar_40.png"<br /> ];<br /> <br /> <br /> private function initCatalog(items:Array):void<br /> {<br /> catalog = new ArrayCollection(items);<br /> myList.dataProvider = catalog;<br /> }<br /> <br /> <br /> </mx:Script><br /> <mx:VBox height="20" width="40%" xmlns:mx="http://www.adobe.com/2006/mxml"<br /> horizontalScrollPolicy="off" <br /> verticalScrollPolicy="off"><br /> <mx:HorizontalList width="100%" id="myList" <br /> horizontalScrollPolicy="off"<br /> verticalScrollPolicy="off"<br /> columnCount="4" <br /> creationComplete="initCatalog(cat)"><br /> <mx:itemRenderer><br /> <mx:Component><br /> <mx:Image width="50%" height="20"<br /> maintainAspectRatio="false"/> <br /> </mx:Component><br /> </mx:itemRenderer><br /> </mx:HorizontalList><br /> </mx:VBox><br /><br /></mx:Application><br /><br />This is a test I've done to see if I can palce a list of images in a cell,<br />and I can :)<br /><br />I have 2 problems:<br /><br />1. Here the size of each image is contant, I need a way to set each image in the list to be different,<br />Can I do it? <br />2. I need to load the images dynamically and not from a fixed Array,<br />Can I do it?<br /><br />It will be great to get help.....<br />Thanks<br />Jo
