Flex 淡入淡出的效果
发布时间:2020-12-15 05:14:12 所属栏目:百科 来源:网络整理
导读:?xml version="1.0"? !-- Simple example to demonstrate the Fade effect. -- mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="360" width="436" mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/ mx:Fade id="fad
<?xml version="1.0"?> <!-- Simple example to demonstrate the Fade effect. --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="360" width="436"> <mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/> <mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/> <mx:Panel title="Fade Effect Example" width="356" height="310" horizontalAlign="center" layout="absolute"> <mx:Text width="100%" color="blue" fontSize="12" text="使用Fade效果淡入淡出图片"/> <mx:Image source="@Embed(source='meinv.jpg')" id="img" visible="true" hideEffect="{fadeOut}" showEffect="{fadeIn}" x="28" y="26"/> <mx:Button x="88" y="234" label="显示" fontSize="12" click="img.visible=true"/> <mx:Button x="196" y="234" label="隐藏" fontSize="12" click="img.visible=false"/> </mx:Panel> </mx:Application> ? ? alphaFrom指定初始透明度alphaTo表示最终透明度,取值范围都是0.0~1.0,0.0 表示透明,1.0 表示完全不透明。 showEffect事件和hideEffect事件分别指显示时的效果事件和隐藏时的效果事件,duration属性表示效果的时间间隔。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |