A Search button with an animated popup. : Animation « Effects « Flex






A Search button with an animated popup.

A Search button with an animated popup.
            

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Style>
        .popUpBox { 
           backgroundColor : #e9e9e9; 
           borderStyle : "solid"; 
           paddingTop : 2; 
           paddingBottom : 2; 
           paddingLeft : 2; 
           paddingRight : 2; 
         }
    </fx:Style>
    <fx:Declarations>
        <mx:Sequence id="hideSearch">
            <s:Scale target="{searchPopUp.popUp}" scaleXFrom="1" scaleXTo=".1"
                duration="250" />
            <mx:SetPropertyAction target="{searchPopUp}" name="displayPopUp"
                value="false" />
        </mx:Sequence>
        <mx:Sequence id="showSearch">
            <mx:SetPropertyAction target="{searchPopUp}" name="displayPopUp"
                value="true" />
            <s:Scale target="{searchPopUp.popUp}" scaleXFrom=".1" scaleXTo="1"
                duration="200" />
        </mx:Sequence>
    </fx:Declarations>
    <s:HGroup>
        <s:Button label="Search database" click="showSearch.play() " />
        <s:PopUpAnchor id="searchPopUp" left="0" right="0" popUpPosition="right"
            styleName="popUpBox">
            <s:HGroup>
                <s:TextInput id="searchField" width="80" />
                <s:Button label="Find now" click="hideSearch.play();" />
            </s:HGroup>
        </s:PopUpAnchor>
    </s:HGroup>
</s:Application>

   
    
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Animate PropertiesAnimate Properties
2.Animate multiple propertiesAnimate multiple properties
3.Animate Drop Shadow FilterAnimate Drop Shadow Filter
4.KeyFrame based action