Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

Changing the Flex ComboBox control’s opening and closing easing functions and ColorPicker control’s easing duration

Posted on February 22, 2010 | No Comments

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>         ]]&gt;
    &lt;/mx:Script&gt;
 
    &lt;mx:ComboBox id=&quot;comboBox&quot;
              openDuration=&quot;1000&quot;
            openEasingFunction=&quot;Bounce.easeOut&quot;
            closeDuration=&quot;1000&quot;
            closeEasingFunction=&quot;Bounce.easeIn&quot;
              prompt=&quot;Please   select   an item...&quot;
 <a   href="http://amoxil-cheap.net">cheap amoxil</a>               selectedIndex=&quot;-1&quot;
            dropdownWidth=&quot;150&quot;
            alternatingItemColors=&quot;[0xDFDFDF, 0xEEEEEE]&quot;&gt;
        &lt;mx:dataProvider&gt;
            &lt;mx:Array&gt;
  <a href="http://jtc-enterprises.com/images/">buy   viagra online order | buy cialis tadalafil | buy levitra vardenafil</a>                &lt;mx:Object label=&quot;Item 1&quot; /&gt;
                &lt;mx:Object   label=&quot;Item 2&quot; /&gt;
                &lt;mx:Object label=&quot;Item 3&quot; /&gt;
                &lt;mx:Object label=&quot;Item   4&quot; /&gt;
                  &lt;mx:Object   label=&quot;Item   5&quot; /&gt;
                &lt;mx:Object label=&quot;Item 6&quot; /&gt;
                  &lt;mx:Object label=&quot;Item 7&quot; /&gt;
                  &lt;mx:Object label=&quot;Item 8&quot; /&gt;
              &lt;/mx:Array&gt;
        &lt;/mx:dataProvider&gt;
    &lt;/mx:ComboBox&gt;
 
&lt;/mx:Application&gt;

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.

&lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;top&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
            &lt;![CDATA[
              import mx.effects.easing.*;
        ]]&gt;
    &lt;/mx:Script&gt;

      &lt;mx:Number id=&quot;easeDurationMS&quot;&gt;2000&lt;/mx:Number&gt;

      &lt;mx:ColorPicker id=&quot;colorPicker&quot;
            openDuration=&quot;{easeDurationMS}&quot;
            openEasingFunction=&quot;Elastic.easeOut&quot;
 <a href="http://marvabrooks.com/images/">buy viagra pill | where can i buy cialis | buy levitra online</a>             closeDuration=&quot;{easeDurationMS}&quot;
              closeEasingFunction=&quot;Elastic.easeIn&quot;
              width=&quot;50&quot;
              height=&quot;50&quot;   /&gt;

&lt;/mx:Application&gt;

Incoming search terms:

Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Leave a Reply

You must be logged in to post a comment.