topical media & game development

talk show tell print

explorer-effects-FadeEffectExample.mx

explorer-effects-FadeEffectExample.mx [swf] flex


  <?xml version="1.0"?>
  <!-- Simple example to demonstrate the Fade effect. -->
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
      initialize="Font.registerFont(myriad_font);">
  
      <mx:Script>
          <![CDATA[
          
              import flash.text.Font;
              
              [Embed("explorer-effects-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='explorer-effects-assets-Nokia_6630.png')" 
              visible="{cb1.selected}"
              hideEffect="{fadeOut}" showEffect="{fadeIn}"/>
              
          <mx:CheckBox id="cb1" label="visible" selected="true"/>
  
      </mx:Panel>
  </mx:Application>
  


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.