OldHawk

菜地一块,欢迎拍砖
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Triggering effects when a container’s visibility is changed

Posted on 2008-01-13 16:11  OldHawk  阅读(392)  评论(0编辑  收藏  举报
The following example shows you how you can trigger effects when the visible property changes on a Flex container or control by using the hideEffect and showEffect effects
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/20/triggering-effects-when-a-containers-visibility-is-changed/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white">

    
<mx:Zoom id="zoom" />

    
<mx:ApplicationControlBar dock="true">
        
<mx:Button label="hide"
                click
="panel.visible = false;"
                enabled
="{panel.visible}" />
        
<mx:Button label="show"
                click
="panel.visible = true;"
                enabled
="{!panel.visible}" />
    
</mx:ApplicationControlBar>

    
<mx:Panel id="panel"
            title
="title"
            status
="status"
            showEffect
="{zoom}"
            hideEffect
="{zoom}"
            width
="100%"
            height
="100%">

        
<mx:ControlBar>
            
<mx:Label text="control bar" />
        
</mx:ControlBar>
    
</mx:Panel>

</mx:Application>