pf » Simple Flex Example

Simple Flex Example

web

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>


Related Entries
21 people found this page useful, what do you think?

Trackback Address: 491/7E41E1789EA45D2F09976FE905536D0E
On 09/04/2007 at 1:56:09 AM MDT Rocky wrote:
1
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

On 02/19/2008 at 10:30:41 PM MST BlindSide wrote:
2
I had to change these values to get the image to fade properly:

minimum="0" maximum="1" snapInterval="0.1"

It seems the images alpha is on a 0 - 1 scale rather than 0 - 100.

Cheers

On 02/26/2008 at 10:54:48 AM MST TomasDev wrote:
3
And, you need to set enabled="true" in the HSlider

On 04/21/2008 at 7:22:34 AM MDT Ragscoon wrote:
4
change="{img.alpha=slider.value}

to this

change="{img.alpha=slider.value/100}




  



Spell Checker by Foundeo





Subscribe to my RSS Feed: solosub RSS
Tags