[flexcoders] Re: Populate TileList w/ data from XML file?
I'll keep an eye on that new class at Ben's blog, but here's how I solved the issue, by creating a custom itemRenderer. A bit of a workaround, but more flexible than using the generic tileList: mx:TileList dataProvider={uniXML} labelField=groupID iconField=thumbnail height=100% width=100% rowHeight=200 columnWidth=125 itemClick=uniLoad(event) mx:itemRenderer mx:Component mx:VBox horizontalAlign=center mx:Image width=110 height=160 source={data.thumbnail}/ mx:Text id=thumbText width=100% height=22 fontSize=9 text={data.top.styleCode.womensStyleCode + '/' + data.top.styleCode.mensStyleCode} / /mx:VBox /mx:Component /mx:itemRenderer /mx:TileList The itemClick loads a SWF that corresponds to the thumbnail in the tileList. Works like a charm! Thanks again for your direction. Sherm --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, daddyo_buckeye projects@ wrote: Amy, Can you be more specific? Would I have to build a class for my images, with the path to the images in the class file? BTW, I've solved this another way (thanks to some folks at the Adobe forums), by using a custom renderer and replacing 'icon' with 'image'. I'll post the code in a bit. The easiest way to create an image class is to embed it [Embed source=images\yourImage.png] private var yourImage:Class; That's just the way icons work http://blog.xsive.co.nz/archives/233. Here's one possible solution http://blog.benstucki.net/?p=42. HTH; Amy
[flexcoders] Re: Populate TileList w/ data from XML file?
I forgot to mention the labelField works fine (displays text in the TileList) but the iconField doesn't display the associated image. --- In flexcoders@yahoogroups.com, daddyo_buckeye [EMAIL PROTECTED] wrote: I'm trying to populate a TileList with data from an XML file. Any help is greatly appreciated. Here's the data from the XML file: ?xml version=1.0 encoding=iso-8859-1? uniforms patternGroup groupIDkj02/groupID sportBasketball/sport groupStyleBasketball Uniform/groupStyle thumbnailassets/basketball/thumbnailsPNG/kj02.png/thumbnail /patternGroup /uniforms Here's the code for the application file: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=uniData.send() mx:Script ![CDATA[ [Bindable] private var uniXML:XMLList; private function uniHandler(evt:ResultEvent):void { uniXML=evt.result.patternGroup; } ]] /mx:Script mx:HTTPService id=uniData url=assets/uniforms.xml result=uniHandler(event) resultFormat=e4x / mx:TileList dataProvider={uniXML} labelField=groupID iconField=thumbnail width=400 height=400 / /mx:Application What am I missing here? thanks.
[flexcoders] Re: Populate TileList w/ data from XML file?
--- In flexcoders@yahoogroups.com, daddyo_buckeye [EMAIL PROTECTED] wrote: I forgot to mention the labelField works fine (displays text in the TileList) but the iconField doesn't display the associated image. I think icons need to take a class rather than a path to an image. HTH; Amy
[flexcoders] Re: Populate TileList w/ data from XML file?
Amy, Can you be more specific? Would I have to build a class for my images, with the path to the images in the class file? BTW, I've solved this another way (thanks to some folks at the Adobe forums), by using a custom renderer and replacing 'icon' with 'image'. I'll post the code in a bit. Sherm --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: I think icons need to take a class rather than a path to an image. HTH; Amy
[flexcoders] Re: Populate TileList w/ data from XML file?
Here's the code: mx:TileList id=tl dataProvider={uniXML} labelField=groupID iconField=thumbnail width=400 height=400 mx:itemRenderer mx:Component mx:HBox mx:Text width=100 height=100 text={data.groupID}/ mx:Image width=100 height=100 source={data.thumbnail}/ /mx:HBox /mx:Component /mx:itemRenderer ...Thanks to Greg Lafrance on the Adobe Flex list. Sherm
[flexcoders] Re: Populate TileList w/ data from XML file?
--- In flexcoders@yahoogroups.com, daddyo_buckeye [EMAIL PROTECTED] wrote: Amy, Can you be more specific? Would I have to build a class for my images, with the path to the images in the class file? BTW, I've solved this another way (thanks to some folks at the Adobe forums), by using a custom renderer and replacing 'icon' with 'image'. I'll post the code in a bit. The easiest way to create an image class is to embed it [Embed source=images\yourImage.png] private var yourImage:Class; That's just the way icons work http://blog.xsive.co.nz/archives/233. Here's one possible solution http://blog.benstucki.net/?p=42. HTH; Amy