Effect With ActionScript
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> import mx.effects.Fade; private function showImage():void{ var myFade:Fade = new Fade(); myFade.target = myImage; myFade.alphaFrom = 0; myFade.alphaTo = 1; myFade.play(); } private function hideImage():void{ var myFade:Fade = new Fade(); myFade.target = myImage; myFade.alphaFrom = 1; myFade.alphaTo = 0; myFade.play(); } </mx:Script> <mx:Image id="myImage" source="logo.jpg" x="150" y="100"/> <mx:Button x="150" y="375" label="Show Image" click="showImage()"/> <mx:Button x="374" y="375" label="Hide Image" click="hideImage()"/> </mx:Application>