<?xml version="1.0"?> <!-- Simple example to demonstrate the Fade effect. --> <!-- 如何使用Flex Fade Effect MyShareBook.cn 翻译 --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="Font.registerFont(myriad_font);"> <mx:Script> <![CDATA[ import flash.text.Font; [Embed("assets/MyriadWebPro.ttf", fontName="MyMyriad")] public var myriad_font:Class; ]]> </mx:Script> <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="95%" height="95%" paddingTop="5" paddingLeft="10" paddingRight="10" paddingBottom="5"> <mx:Text width="100%" color="blue" text="Use the Fade effect to show or hide the text and image. Use an embedded font when applying the Fade effect to text."/> <mx:Label text="Nokia 9930" fontFamily="MyMyriad" fontSize="14" visible="{cb1.selected}" hideEffect="{fadeOut}" showEffect="{fadeIn}"/> <mx:Image source="@Embed(source='assets/Nokia_6630.png')" visible="{cb1.selected}" hideEffect="{fadeOut}" showEffect="{fadeIn}"/> <mx:CheckBox id="cb1" label="visible" selected="true"/> </mx:Panel> </mx:Application>