Tilelist Custom Selected Item Skin

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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?
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139