Change Image source in button action
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()"> <mx:Script> [Embed(source="logo.jpg")] private var sunAsset:Class; [Embed(source="logo.jpg")] private var moonAsset:Class; private function init( ):void { sunImage.source = sunAsset; } private function showMoon( ):void { sunImage.source = moonAsset; } </mx:Script> <mx:Image id="sunImage"/> <mx:Button label="Show the Moon!" click="showMoon( )"/> </mx:Application>