I found this code in one of my databases, and I assume it was taken from the net at some stage just can't recall where & when I got it, but AS IS it is exactly right so I wanted to use it!
I was trying to get some text with it or the title for example into an extra text field yet could not make it work to show the text or title of the selectedIndex etc.
It looks all very strait forward and easy yet NO luck ??? could somebody look at it and suggest an answer !!! would be very much appreciated! Thanks in advance regards aktell
Code:
applicationComplete="service.send()">
<mx:HTTPService
id="service"
url="photos.xml"
resultFormat="e4x"/>
<mx:TabNavigator
width="220"
creationPolicy="all">
<mx:Canvas
label="List View"
width="100%" height="100%">
<mx:List
id="photosList"
width="100%" height="100%"
labelField="@title"
dataProvider="{service.lastResult.photo}"
change="photosTileList.selectedIndex = photosList.selectedIndex"/>
</mx:Canvas>
<mx:Canvas
label="Tile View"
width="100%" height="100%">
<mx:TileList
change="photosList.selectedIndex = photosTileList.selectedIndex"
id="photosTileList"
width="100%" height="100%"
dataProvider="{service.lastResult.photo}">
<mx:itemRenderer>
<mx:Component>
<cacheImg:CachedImage
source="{data.@thumb}"
toolTip="{data.@title}"
width="100" height="60"/>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Canvas>
</mx:TabNavigator>
<mx:Box
width="100%" height="20">
<mx:TextArea
text=" ??? "
width="200" height="20"
color="#ff0000"/>
</mx:Box>
<mx:Image
id="image"
source="{photosList.selectedItem.@image}"/>
</mx:Application>
Code:
XML file: photos.xml
<photos>
<photo
title="text"
thumb="pathway"
image="pathway"/>
<photo
title="text"
thumb="pathway"
image="pathway"/>
</photos>