9

Flex 2 : Clearing the content of an Image Component

 3 years ago
source link: http://www.mikechambers.com/blog/2006/04/18/flex-2-clearing-the-content-of-an-image-component/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Flex 2 : Clearing the content of an Image Component

Tuesday, April 18, 2006

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK