Recipe 15.10. Working with Combo Box Styles


Problem

You want to apply style settings to a combo box.

Solution

Use the same style properties as a list component, plus the additional properties openDuration and openEasing.

Discussion

Combo boxes use many of the same style properties as list components, largely because the drop-down portion of the combo box is actually a list instance. Therefore, you can style the drop-down portion of a combo box in the same way you style a standard list.

In addition to the list style properties and the standard style properties, combo boxes have two extra style properties: openDuration and openEasing. These two properties affect how the combo box expands and collapses. The openDuration property allows you to specify how many milliseconds the open or close animation takes, and the openEasing property allows you to specify how the combo box expands and collapses. Assign a numeric value to the openDuration property. For example, the following code specifies that the opening and closing of combo boxes should take one second:

 _global.style.setStyle("openDuration", 1000); 

You can assign any easing function reference to the openEasing style property. You can find a list of the built-in easing functions in Recipe 11.3. The following code assigns a standard ease out to combo boxes globally:

 _global.style.setStyle("openEasing", mx.transitions.easing.Regular.easeOut); 




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net