Setting skins on the the Flex ButtonBar control
The following example shows how you can skin the ButtonBar control in Flex by setting the <?xml version="1.0" encoding="utf-8"?>buttonStyleName
style and setting one or more of the following skin styles: skin
, upSkin
, overSkin
, downSkin
, disabledSkin
.
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Style>
ButtonBar {
buttonStyleName: myCustomButtonStyleName;
color: #999999;
}
.myCustomButtonStyleName {
skin: Embed(source="assets/ButtonBarSkins.swf",
symbol="ButtonBarButton_skin");
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.events.SliderEvent;
private function slider_change(evt:SliderEvent):void {
buttonBar.setStyle("buttonHeight", evt.value);
}
]]>
</mx:Script>
<mx:Array id="arr">
<mx:Object label="Button" />
<mx:Object label="ButtonBar" />
<mx:Object label="ColorPicker" />
<mx:Object label="ComboBox" />
</mx:Array>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="buttonHeight:">
<mx:HSlider id="slider"
minimum="24"
maximum="64"
snapInterval="1"
tickInterval="4"
liveDragging="true"
change="slider_change(event);" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:ButtonBar id="buttonBar"
dataProvider="{arr}" />
</mx:Application>
10:42 AM
|
Labels:
Flex Controls Samples,
Flex Menu Samples,
Flex Samples
|
This entry was posted on 10:42 AM
and is filed under
Flex Controls Samples
,
Flex Menu Samples
,
Flex Samples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment