Set control to invisible during transition : Transition « Effects « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Effects » TransitionScreenshots 
Set control to invisible during transition
Set control to invisible during transition
         
<?xml version="1.0" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  verticalAlign="middle" layout="vertical">
  <mx:states>
    <mx:State name="OneOnly">
      <mx:SetProperty target="{p2}" name="visible" value="false" />
      <mx:SetProperty target="{p2}" name="includeInLayout" value="false" />
    </mx:State>
  </mx:states>
  <mx:transitions>
    <mx:Transition id="toOneOnly" fromState="*" toState="OneOnly">
      <mx:Sequence id="t1" targets="{[p2]}">
        <mx:Iris showTarget="false" duration="500" />
        <mx:SetPropertyAction name="visible" />
        <mx:SetPropertyAction target="{p2}" name="includeInLayout" />
      </mx:Sequence>
    </mx:Transition>
  </mx:transitions>
  <mx:Panel id="p1" title="One" width="100" height="100">
    <mx:Label text="One" />
  </mx:Panel>
  <mx:Panel id="p2" title="Two" width="100" height="100">
    <mx:Label text="Two" />
  </mx:Panel>
  <mx:Button id="b1" label="Change state" click="currentState = currentState == 'OneOnly' ? '' : 'OneOnly';" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Wrap Parallel, fade and move with TransitionWrap Parallel, fade and move with Transition
2.Use Transition to add and remove controls dynamicallyUse Transition to add and remove controls dynamically
3.Define transitions for this example in MXML using the tagDefine transitions for this example in MXML using the <mx:transitions> tag
4.Using a filter in TransitionUsing a filter in Transition
5.Advanced Transitions: Move, Rotate, ResizeAdvanced Transitions: Move, Rotate, Resize
6.Transitions with tagTransitions with <s:transitions> tag
7.Transition With BlursTransition With Blurs
8.Action TransitionsAction Transitions
9.Custom AnimateTransitionShader TransformCustom AnimateTransitionShader Transform
10.Using a filterUsing a filter
11.Defining a custom filterDefining a custom filter
12.Change button position and fade buttonChange button position and fade button
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.