Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Chris Ivens #1
Re: Tilelist Custom Selected Item Skin
Has anyone found a solution to this? I'm trying to do a similar thing. It would be great if it were possible to detect whether the item is selected or not within an itemRenderer.
Chris Ivens Guest
-
TileList Item Renderer
In my Item Renderer for my Tilelist component, I want to know how to set the source of the image and label components. I am having trouble because... -
Change state of custom skin
Quite simply, I want to access MySkin.currentState = 'over'. Is this possible? If so, how am I supposed to get a handle on the skin? -
play effect when removing item from TileList
I want to play an effect when removing an item from a TileList. I tried several different methods, such as defining a removedeffect for the... -
How to custom a control skin~?
Even when you succeed in applying your own custom skins to a button, you encounter problems when you resize them. For example a very long button... -
can't set the selected item of the dropdownlist
I generate template columns in datagrid dynamic and I want dropdownlist in the EditItemTemplate, I did it But I can't set the selected item of... -
Chris Ivens #2
Re: Tilelist Custom Selected Item Skin
I think I have a way of making it work without too many overheads. ListBase has
a few functions to help with the drawing of items so overriding them and adding
a little extra functionality seemed to be easy enough.
Create a custom actionscript class that extends the relevant list type; in my
case TileList. Override the drawItem method to pass the 'selected' variable
into the itemRenderer.
So basically the item is your itemrenderer and calling a setter/getter or any
other method is possible as the item is drawn. Seems to work well for me.
package com.example.controls {
import mx.controls.TileList;
import mx.controls.listClasses.IListItemRenderer;
import com.example.ir.*;
public class ToggleList extends TileList {
public function ToggleList() {
super();
}
override protected function drawItem(item:IListItemRenderer,
selected:Boolean = false,
highlighted:Boolean = false,
caret:Boolean = false,
transition:Boolean = false):void {
super.drawItem(item, selected, highlighted, caret, transition);
SomeItemRenderer(item).toggleSelection(selected);
}
}
}
Chris Ivens Guest



Reply With Quote

