Drop Down Palette Flex Component

Posted by Kristofer Joseph Thu, 04 Sep 2008 23:07:24 GMT

I have been wanting an excuse to build a custom component ever since 360 | Flex last month. I decided to create a drop down palette using standard Flex controls instead of coding one from scratch in Flash. It was much easier than I expected it to be. I was able to take a ComboBox control and pass it a TileList as it’s dropdown list.

drop down palette

Demo Link

*sexy Black & Blue icons courtesy of icondrawer

The trick is that there is a getter for dropdown in mx.combobox but there is no setter. Instead there is a dropDownFactory property that you can pass a ClassFactory to. Furthermore there is a properties object to the ClassFactory where you can specify all of the properties you want to set on your TileList such as columnWidth and rowHeight.

var dropDownClassFactory:ClassFactory = new ClassFactory(TileList);
dropDownClassFactory.properties = {dataProvider:_data, rowCount:3, columnCount:3, rowHeight:150, columnWidth:150, height:450};
dropdownFactory = dropDownClassFactory;

pretty slick. I am going to flesh this out though into a true component from this proof of concept. I want to create my own factory to be able to pass style information as well as have the TileList manage it’s own width and height based on the item renderers. Look for another post on this soon.

1 comment | atom

Comments

Leave a response

  1. Andrew
    10 months later:

    Exactly what I need… but can’t figure it out. No source?

Leave a comment