handoyo
handoyo

Reputation: 81

How do you create this type of combobox in Flex?

Has anyone ever created a combobox like the one below taken from the Bombay Sapphire website?

It's cool to me, does anyone know how to do this?

Combo Box http://img194.imageshack.us/img194/3079/comboboxx.jpg

Upvotes: 2

Views: 831

Answers (3)

James Ward
James Ward

Reputation: 29433

I've created a very basic Flex example that has some of this behavior. You can see the demo here:
http://www.jamesward.com/demos/SapphireComboBox/SapphireComboBox.html

The code is here:
http://www.jamesward.com/demos/SapphireComboBox/srcview/index.html

Upvotes: 3

Vinay Sajip
Vinay Sajip

Reputation: 99315

It looks nice, but I don't think it's anything special. I'm not even sure it's a ComboBox - for example, select "2008" for the year and then hover over the year "combo" again. It centres on 1987 even though it should be showing years around 2008. It certainly doesn't need to be a ComboBox, just to look like one.

It's easy enough to set up - a control which looks like a combo, with an event handler for mouse in/mouse out which pops up the list. This could be an actual list with mousemove handlers which handle the scrolling on mouse movement near the vertical limits of the list. The "halo" effect is easy enough to generate with suitable blur filters and opacity settings.

It's too long-winded to give the detailed steps, but technically it's not hard to do.

Update: Sorry, I don't have an equivalent ready-to-show example to point you to.

Upvotes: 0

wyldebill
wyldebill

Reputation: 53

I am fairly certain the technology to do this is in Silverlight 3 as well. I am not saying it would be easy however. The way the numbers scroll inside the rectangle for one...

If you are serious about making something like this you would need to understand -visual state managers in silverlight -storyboards in silverlight -maybe pixel shaders in silverlight 3 to do that halo around the rectangle on mouseover -canvas and clipping to do the rolling dates/months/days?

Interested to see what others think.

Upvotes: -1

Related Questions