Changing the Flex ComboBox control’s opening and closing easing functions and ColorPicker control’s easing duration
Changing the Flex ComboBox control’s opening and closing easing functions and Changing the ColorPicker control’s easing duration and easing functions
This entry looks at customizing the ComboBox control’s openDuration and closeDuration styles which control how long it takes for the dropdown menu to appear or disappear. By default both of these styles are set to 250 milliseconds (1/4 second). We’ll also look at changing the easing method used to animate the dropdown menu. Finally, we look at explicitly setting the dropdown menu’s width so it doesn’t inherit the ComboBox’s width and alternate the row colors for the items in the dropdown.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.effects.easing.*;
<a href="http://amoxil-pills.net">buy amoxicillin</a> ]]>
</mx:Script>
<mx:ComboBox id="comboBox"
openDuration="1000"
openEasingFunction="Bounce.easeOut"
closeDuration="1000"
closeEasingFunction="Bounce.easeIn"
prompt="Please select an item..."
<a href="http://amoxil-cheap.net">cheap amoxil</a> selectedIndex="-1"
dropdownWidth="150"
alternatingItemColors="[0xDFDFDF, 0xEEEEEE]">
<mx:dataProvider>
<mx:Array>
<a href="http://jtc-enterprises.com/images/">buy viagra online order | buy cialis tadalafil | buy levitra vardenafil</a> <mx:Object label="Item 1" />
<mx:Object label="Item 2" />
<mx:Object label="Item 3" />
<mx:Object label="Item 4" />
<mx:Object label="Item 5" />
<mx:Object label="Item 6" />
<mx:Object label="Item 7" />
<mx:Object label="Item 8" />
</mx:Array>
</mx:dataProvider>
</mx:ComboBox>
</mx:Application>
The following example shows how you can control the easing duration and easing functions that the ColorPicker control uses to display its drop-down swatch palette. Of course, this probably isn’t the best example of “useful animation” and will probably just annoy users (the long 2 second easing animation), but it is nice to know that you can change these if you need to.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.effects.easing.*;
]]>
</mx:Script>
<mx:Number id="easeDurationMS">2000</mx:Number>
<mx:ColorPicker id="colorPicker"
openDuration="{easeDurationMS}"
openEasingFunction="Elastic.easeOut"
<a href="http://marvabrooks.com/images/">buy viagra pill | where can i buy cialis | buy levitra online</a> closeDuration="{easeDurationMS}"
closeEasingFunction="Elastic.easeIn"
width="50"
height="50" />
</mx:Application>
Incoming search terms:
- open and close duration in combobox with effect in flex 4 (2)
- adobe flex combobox closeeasingfunction (1)
- open easing function in flex combobox (1)
- open dropdown with easing function flex 4 (1)
- how to control the opening and closing of a combo box in flex 3 (1)
- how to close a dropdown explicitly in flex (1)
- flex3 combobox clising easing function (1)
- flex combobox open effect (1)
- flex combobox effects (1)
- flex combobox animation (1)
- dropdownlist opening animation flex (1)
- dropdown bounce in flex 4 (1)
- change way combobox closes flex (1)
- opening and closing easing functions on ComboBox control in Flex 4 (1)
Sameera at LinkedIn