LetsFlex

Skinning a Button

by jlagunas on Jun.03, 2008, under Skinning

The following example shows you how to apply a background image to a button based on its current state. (Note: To view the disabled skin just add enabled=”false” to your button)


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="0" backgroundColor="0x000000" viewSourceURL="srcview/index.html">

	<mx:Style>
		Button
		{
			font-family: "Verdana";
			font-size: 11px;
			color: #ffffff;
			text-selected-color: #7e929d;
			text-roll-over-color: #ffffff;

			up-skin: Embed(source="assets/upSkin.png");
			over-skin: Embed(source="assets/overSkin.png");
			down-skin: Embed(source="assets/downSkin.png");
			disabled-skin: Embed(source="assets/disabledSkin.png");
		}
	</mx:Style>

	<mx:Button label="lets flex" buttonMode="true" width="143" height="48" horizontalCenter="0" verticalCenter="0" />

</mx:Application>
:,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...