So after playing with my buddies iPhone the other day I realized i had the animation all wrong. So I’ve corrected that and also tried to size it closer to a normal flex button.
My current strategy for implementing the iPhoneToggle is to just use it as a skin of a normal checkbox component using the following code in the flex style declaration:
1 2 3 4 5 6 7 | <mx:Style>
CheckBox {
skin: ClassReference("iPhoneToggleControl");
}
</mx:Style> |
Seems to be a decent approach and it has some advantages, but I’d like to be able to allow for changing colors and on/off labels through the component properties. So if I can figure out how to just extend the checkbox while using the skins exported from flash I would switch to that.
Here is my latest progress.
edit: i’ve added an over state with some texture on the switch button. for some reason i can’t get it to not show up for the selectedUp state.
edit: i just added transparent icon to substitute for the icon to get rid of it, not great looking code.
5 Comments until now
To change the colors or other graphics properties, you may want to see what you can do with skins created using Degrafa. Check it out at http://www.degrafa.com
I found a html only one, that uses mootools:
http://www.reaktivo.com/mt/mooswitch
awesome find Alejandro! I’ve been using mootools a lot recently so this is good link to have.
I have taken a break from improving this flex control but once i get some free time i may take another shot at it.
Hi,
Where can I find source for this component?
I would really appreciate it.
-Hem
Hi Hern,
I forgot I never put the source up here, I will try to add it this evening!
Add your Comment!