Use load() method to replace image
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> private function afterImage():void { image1.load('http://localhost:8100/logo.jpg'); } </mx:Script> <mx:VBox id="vbox0" width="150" height="100"> <mx:Image id="image1" source="logo.jpg" /> <mx:Button id="myButton" label="Show Second Image" click="afterImage();" /> </mx:VBox> </mx:Application>