Simple Flex Example

by Pete Freitag

Here's an even simpler flex example that I showed in my Flex presentation today. It uses a horizontal slider component to change the alpha transparency of an image.

<?xml version="1.0" ?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
	<mx:HSlider id="slider" minimum="0" maximum="100" snapInterval="10" change="{img.alpha=slider.value}" />
	<mx:Image source="http://www.petefreitag.com/images/blog/kayaks.jpg" id="img" alpha="0" />
</mx:Application>

Comments

Rocky

Dude, I copy and paste the code to the source but the opactiy only limited to 0% and 100%, there's no transparency in the image

TomasDev

And, you need to set enabled="true" in the HSlider

Sagar

please keeps send me the daily