Mike Chambers

code = joy

Flex 2 : Clearing the content of an Image Component

with one comment

Just a quick tip, but if you need to clear the content of a Flex 2 Image component, just set the source to null:

Here is a simple example

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">

	<mx:Image height="500" width="500"
		id="imageLoader"
		source="http://images.amazon.com/images/P/B0007NFMDK.01.LZZZZZZZ.jpg"
		completeEffect="Fade"  horizontalCenter="0"/>

	<mx:Button label="Clear Image" horizontalCenter="0" top="508"
		click="imageLoader.source = null"/>

</mx:Application>

It is simple, but took me a while to figure out.

Written by mikechambers

April 18th, 2006 at 12:28 am

Posted in General

One Response to 'Flex 2 : Clearing the content of an Image Component'

Subscribe to comments with RSS

  1. hacks mate, shouldn’t have to!
    anyways, nice Dutch train ;)

    Daniel

    18 Apr 06 at 4:02 am

Leave a Reply