Confusion in Flex Tilelist highlight
Hi,
I'm noob in flex. I have problem in flex tilelist highlight. I have a tilelist
inside a tilelist. I rendered the xml properly but the problem is when I select
an item. Whenever one item is selected and I've select another item the
highlight in the first selected item remains and the other item that I've
selected have a highlight too. In other words two item in the tilelist have a
highlight. Another thing is the number of rowcount have excess. How can I
prevent that since they have different number of child node. Please help.
Thanks.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="sailing.send()">
<mx:HTTPService id="sailing" useProxy="false" resultFormat="e4x"
url="{'xml/category.xml'}"/>
<mx:Canvas width="169" height="313" backgroundColor="0xd6001b" y="10" x="57"
id="red">
<mx:TileList width="150" id="filmstrip" backgroundAlpha="0" x="7" y="4"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
dataProvider="{sailing.lastResult.image}" useRollOver="false"
selectable="false" >
<mx:itemRenderer>
<mx:Component>
<mx:VBox verticalGap="-1" verticalScrollPolicy="off"
horizontalScrollPolicy="off" autoLayout="true" height="100" >
<mx:Canvas id="head1" width="150" height="18" borderStyle="solid"
horizontalScrollPolicy="off" verticalScrollPolicy="off"
backgroundColor="#6b000d">
<mx:Label id="category" text="{data.@category}" width="135" height="17"
fontSize="12" color="#ffffff" y="-1" x="6" fontFamily="Arial" fontWeight="bold"
fontStyle="italic"/>
<mx:Label text="{parentApplication.sailing.lastResult.image. (@category
== category.text).subcat.length()}"/>
</mx:Canvas>
<mx:TileList width="150" id="filmstrip2" backgroundAlpha="0" x="7"
y="4" paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
dataProvider="{parentApplication.sailing.lastResul t.image.(@category ==
category.text).subcat}">
<mx:itemRenderer>
<mx:Component>
<!--<mx:VBox verticalGap="-1">-->
<mx:Canvas width="150" height="18" borderStyle="solid"
horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Label text="{data.@cats}" width="135" height="17"
fontSize="12" color="#ffffff" y="-1" x="6" fontFamily="Arial" fontWeight="bold"
fontStyle="italic"/>
</mx:Canvas>
<!--</mx:VBox>-->
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Canvas>
</mx:Application>
category.xml
<?xml version="1.0" encoding="utf-8"?>
<gallery>
<image category="SAILING">
<subcat id="1" cats="-OFF"/>
<subcat id="2" cats="-ON"/>
<subcat id="3" cats="-SHOE"/>
</image>
<image category="SPORTS">
<subcat id="4" cats="-MALE"/>
<subcat id="5" cats="-FEMALE"/>
<subcat id="6" cats="-UNKNOWN"/>
</image>
<image category="GOLF">
<subcat id="7" cats="-OFF"/>
<subcat id="8" cats="-ON"/>
<subcat id="9" cats="-SHOE"/>
<subcat id="9" cats="-SHOE"/>
<subcat id="9" cats="-SHOE"/>
</image>
</gallery>
|