I'm struggling to reproduce the gradient fill of this chart. Are there tools that help testing GradientEntry properties on fills?
I finally got it right. Below the code if you are interested
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var dummyData:ArrayCollection = new ArrayCollection([
{ x:10, y1: 2000, y2:1200 },
{ x:20, y1: 3000, y2:1000 },
{ x:30, y1: 2000, y2:1500 },
{ x:40, y1: 1800, y2:1200 },
{ x:50, y1: 2000, y2:1400 },
{ x:60, y1: 1500, y2:1200 },
{ x:70, y1: 2000, y2:1200 },
{ x:80, y1: 1500, y2:2000 },
{ x:90, y1: 1500, y2:2500 },
{ x:100, y1: 1800, y2:1700 },
{ x:110, y1: 2400, y2:1200 },
{ x:120, y1: 3000, y2:1500 },
{ x:130, y1: 200, y2:200 }
]);
]]>
</mx:Script>
<mx:Panel title="Area Chart">
<mx:AreaChart id="myChart" dataProvider="{dummyData}"
showDataTips="true" >
<mx:fill>
<mx:SolidColor color="#000000" />
</mx:fill>
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{dummyData}"
categoryField="x"
/>
</mx:horizontalAxis>
<mx:series>
<mx:AreaSeries yField="y1" displayName="y1">
<mx:areaStroke>
<mx:Stroke color="#00688B" weight="2"/>
</mx:areaStroke>
<mx:areaFill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:GradientEntry color="#00688B" alpha="0.8" />
<mx:GradientEntry color="#005B79" alpha="0.8" />
<mx:GradientEntry color="#00475F" alpha="0.8" />
<mx:GradientEntry color="#003445" alpha="0.5" />
<mx:GradientEntry color="#002734" alpha="0.5" />
<mx:GradientEntry color="#00131A" alpha="0.5" />
<mx:GradientEntry color="#000000" alpha="0.2" />
</mx:entries>
</mx:LinearGradient>
</mx:areaFill>
</mx:AreaSeries>
<mx:AreaSeries yField="y2" displayName="y2">
<mx:areaStroke>
<mx:Stroke color="#FF7D40" weight="2"/>
</mx:areaStroke>
<mx:areaFill>
<mx:LinearGradient angle="90">
<mx:entries>
<mx:GradientEntry color="#FF7D40" alpha="0.8" />
<mx:GradientEntry color="#EF753C" alpha="0.8" />
<mx:GradientEntry color="#DF6D38" alpha="0.8" />
<mx:GradientEntry color="#AF552C" alpha="0.5" />
<mx:GradientEntry color="#6F361C" alpha="0.5" />
<mx:GradientEntry color="#4F2714" alpha="0.5" />
<mx:GradientEntry color="#000000" alpha="0.2" />
</mx:entries>
</mx:LinearGradient>
</mx:areaFill>
</mx:AreaSeries>
</mx:series>
</mx:AreaChart>
</mx:Panel>
</mx:Application>
Related
I need to let the user toggle the visibility of the separator lines between columns and rows in a spark datagrid. I tried to make a method in its skin class to do that (made a new skin class) like this:
<fx:Component id="columnSeparator">
<s:Line>
<fx:Script>
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
public function set columnSeperatorVisible(value:Boolean):void
{
if(value){
columnSeperatorLine.alpha = 1;
}
else{
columnSeperatorLine.alpha = 0;
}
}
]]>
</fx:Script>
<s:stroke>
<s:SolidColorStroke color="0xE6E6E6" weight="1" caps="square" id="columnSeperatorLine" />
</s:stroke>
</s:Line>
</fx:Component>
But i cant access that method from the script block of the actual skin, nor when using
datagrid.skin.columnSeperatorVisible = false;
I dont want to make 4 different skin classes which have different seperator line visibility that i can assign to the datagird, so does any know how i can do this?
I use a custom skin:
<s:SparkSkin
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
alpha.disabled="0.5" minWidth="89" minHeight="84" xmlns:skins="xxx.xxx.xxx.xxx">
<fx:Metadata>
<![CDATA[
/**
* #copy spark.skins.spark.ApplicationSkin#hostComponent
*
* #langversion 3.0
* #playerversion Flash 10
* #playerversion AIR 2.5
* #productversion Flex 4.5
*/
[HostComponent("spark.components.DataGrid")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<fx:Declarations>
<!--- #private -->
<fx:Component id="alternatingRowColorsBackground">
<s:Rect implements="spark.components.gridClasses.IGridVisualElement">
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
/**
* #private
*/
public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
{
const dataGrid:DataGrid = grid.dataGrid;
if (!dataGrid)
return;
const colors:Array = dataGrid.getStyle("alternatingRowColors");
if (colors && (colors.length > 0))
{
dataGrid.styleManager.getColorNames(colors); // lazily replace color names with ints
rowBackgroundFillColor.color = colors[rowIndex % colors.length];
}
else
{
// This should be the same as bgFill.color.
rowBackgroundFillColor.color = 0xFFFFFF;
}
}
]]>
</fx:Script>
<s:fill>
<!--- #private -->
<s:SolidColor id="rowBackgroundFillColor" color="0xFFFFFF"/>
</s:fill>
</s:Rect>
</fx:Component>
<!--- #private -->
<fx:Component id="caretIndicator">
<s:Rect implements="spark.components.gridClasses.IGridVisualElement">
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
/**
* #private
*/
public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
{
const dataGrid:DataGrid = grid.dataGrid;
if (!dataGrid)
return;
const color:uint = dataGrid.getStyle("caretColor");
caretIndicatorFill.color = color;
}
]]>
</fx:Script>
<s:stroke>
<!--- #private -->
<s:SolidColorStroke id="caretIndicatorFill" color="0x0167FF" weight="1"/>
</s:stroke>
</s:Rect>
</fx:Component>
<!--- #private -->
<fx:Component id="columnSeparator">
<s:Line>
<fx:Script>
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
public function set columnSeperatorVisible(value:Boolean):void
{
if(value){
columnSeperatorLine.alpha = 1;
}
else{
columnSeperatorLine.alpha = 0;
}
}
]]>
</fx:Script>
<s:stroke>
<s:SolidColorStroke color="0xE6E6E6" weight="1" caps="square" id="columnSeperatorLine" />
</s:stroke>
</s:Line>
</fx:Component>
<!---
Defines the appearance of the drop indicator.
The DataGrid's layout takes care to size and position the dropIndicator.
-->
<fx:Component id="dropIndicator">
<s:Group>
<s:Rect left="0" right="0" top="0" bottom="0">
<s:fill>
<!--- Defines the color of the background. -->
<s:SolidColor color="0xBBBBBB" />
</s:fill>
<s:stroke>
<s:SolidColorStroke color="0x868686" weight="1"/>
</s:stroke>
</s:Rect>
</s:Group>
</fx:Component>
<!--- Defines the value of the columnSeparator property for the columnHeaderGroup. -->
<fx:Component id="headerColumnSeparator">
<s:Line>
<s:stroke>
<s:SolidColorStroke color="0xFFFFFF" weight="1" caps="square"/>
</s:stroke>
</s:Line>
</fx:Component>
<!--- Defines the value of the headerRenderer property for the columnHeaderGroup.
The default is spark.skins.spark.DefaultGridHeaderRenderer -->
<fx:Component id="headerRenderer">
<skins:AirDataGridHeaderRenderer/>
</fx:Component>
<!--- #private -->
<fx:Component id="hoverIndicator">
<s:Rect implements="spark.components.gridClasses.IGridVisualElement">
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
/**
* #private
*/
public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
{
const dataGrid:DataGrid = grid.dataGrid;
if (!dataGrid)
return;
const color:uint = dataGrid.getStyle("rollOverColor");
hoverIndicatorFill.color = color;
}
]]>
</fx:Script>
<s:fill>
<!--- #private -->
<s:SolidColor id="hoverIndicatorFill" color="0xCEDBEF"/>
</s:fill>
</s:Rect>
</fx:Component>
<!--- #private -->
<fx:Component id="rowSeparator">
<s:Line>
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
public function set rowSeperatorVisible(value:Boolean):void
{
if(value){
rowSeperatorLine.alpha = 1;
}
else{
rowSeperatorLine.alpha = 0;
}
}
]]>
</fx:Script>
<s:stroke>
<s:SolidColorStroke color="0xE6E6E6" weight="1" caps="square" id="rowSeperatorLine"/>
</s:stroke>
</s:Line>
</fx:Component>
<!--- #private -->
<fx:Component id="selectionIndicator">
<s:Rect implements="spark.components.gridClasses.IGridVisualElement">
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.DataGrid;
import spark.components.Grid;
/**
* #private
*/
public function prepareGridVisualElement(grid:Grid, rowIndex:int, columnIndex:int):void
{
const dataGrid:DataGrid = grid.dataGrid;
if (!dataGrid)
return;
const color:uint = dataGrid.getStyle("selectionColor");
selectionIndicatorFill.color = color;
}
]]>
</fx:Script>
<s:fill>
<!--- #private -->
<s:SolidColor id="selectionIndicatorFill" color="0xA8C6EE"/>
</s:fill>
</s:Rect>
</fx:Component>
<!--- #private -->
<fx:Component id="editorIndicator">
<s:Rect>
<s:fill>
<s:SolidColor color="0xFFFFFF"/>
</s:fill>
</s:Rect>
</fx:Component>
</fx:Declarations>
<fx:Script fb:purpose="styling">
<![CDATA[
import mx.events.FlexEvent;
static private const exclusions:Array = ["scroller", "background", "columnHeaderGroup"];
static private const contentFill:Array = ["bgFill"];
/**
* #private
*/
override public function get colorizeExclusions():Array {return exclusions;}
/**
* #private
*/
override public function get contentItems():Array {return contentFill};
/**
* #private
*/
override protected function initializationComplete():void
{
useChromeColor = true;
super.initializationComplete();
}
/**
* #private
*/
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
if (getStyle("borderVisible") == true)
{
border.visible = true;
background.left = background.top = background.right = background.bottom = 1;
scroller.minViewportInset = 1;
}
else
{
border.visible = false;
background.left = background.top = background.right = background.bottom = 0;
scroller.minViewportInset = 0;
}
borderStroke.color = getStyle("borderColor");
borderStroke.alpha = getStyle("borderAlpha");
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
/* public function set rowSeperatorVisible(value:Boolean):void
{
var test:* = grid.rowSeparator.newInstance();
test.rowSeperatorVisible = value;
grid.rowSeparator = test as IFactory;
}
public function set columnSeperatorVisible(value:Boolean):void
{
var test:* = grid.columnSeparator.newInstance();
test.columnSeperatorVisible = value;
grid.columnSeparator = test as IFactory;
} */
]]>
</fx:Script>
<!-- column header, content -->
<s:VGroup horizontalAlign="justify" gap="0" left="0" right="0" top="0" bottom="0">
<!--- #private
The GridColumnHeaderGroup's padding values are used to line it up with the Grid
which is inset by the Scroller's minViewportInset, which provides room for the
DataGrid border - the last Rect element below.
-->
<s:GridColumnHeaderGroup id="columnHeaderGroup" minHeight="21"
paddingLeft="1" paddingRight="1" paddingTop="1"
columnSeparator="{headerColumnSeparator}"
headerRenderer="{headerRenderer}"/>
<s:Group height="100%">
<!--- #private -->
<s:Rect id="background" left="1" right="1" top="1" bottom="1" >
<s:fill>
<!--- Defines the color of the background. The default color is 0xFFFFFF. -->
<s:SolidColor id="bgFill" color="#22A86D" />
</s:fill>
</s:Rect>
<!-- header separator, scroller and grid -->
<s:VGroup horizontalAlign="justify" height="100%" width="100%" gap="-1">
<!--- #private -->
<s:Line id="headerSeparator">
<s:stroke>
<s:SolidColorStroke color="0xE6E6E6" weight="1" caps="square"/>
</s:stroke>
</s:Line>
<!--- #private -->
<s:Scroller id="scroller" minViewportInset="1" hasFocusableChildren="false" height="100%">
<!--- #private -->
<s:Grid id="grid" itemRenderer="spark.skins.spark.DefaultGridItemRenderer">
<s:gridView>
<fx:Component>
<s:GridView>
<s:GridLayer name="backgroundLayer"/>
<s:GridLayer name="selectionLayer"/>
<s:GridLayer name="editorIndicatorLayer"/>
<s:GridLayer name="rendererLayer"/>
<s:GridLayer name="overlayLayer"/>
</s:GridView>
</fx:Component>
</s:gridView>
</s:Grid>
</s:Scroller>
</s:VGroup>
</s:Group>
</s:VGroup>
<!-- border -->
<!--- #private -->
<s:Rect left="0" right="0" top="0" bottom="0" id="border">
<s:stroke>
<!--- #private -->
<s:SolidColorStroke id="borderStroke" weight="1"/>
</s:stroke>
</s:Rect>
And this code changes the visibility
var overlayLayer:GridLayer = (this.grid.getChildByName('overlayLayer') as GridLayer);
if(overlayLayer){
overlayLayer.visible = Global.stringToBoolean(item.value);
}
Column and row separators are located on overlayLayer of the grid. So, the way to toggle their visibility is:
var overlayLayer:GridLayer = dataGrid.grid.getChildByName('overlayLayer');
overlayLayer.visible = !overlayLayer.visible;
If you're using custom skin, make sure overlayLayer is present in your skin. You can copy all the layers from SDK skin:
<s:Grid id="grid" itemRenderer="spark.skins.spark.DefaultGridItemRenderer">
<s:GridLayer name="backgroundLayer"/>
<s:GridLayer name="selectionLayer"/>
<s:GridLayer name="editorIndicatorLayer"/>
<s:GridLayer name="rendererLayer"/>
<s:GridLayer name="overlayLayer"/>
</s:Grid>
For SDK 4.10 try
DisplayObjectContainer(dataGrid.grid.getElementAt(0)).getChildByName('overlayLayer').visible = ...
I am using property popUpWidthMatchesAnchorWidth="false" in combobbox skin to set maximum width of dropdown.
In this everytime updating dataprovider on user types in combobox.whenever dataprovider changes,dropdown width is not adjusting to maximum width and also not positioning properly.
On Dataprovider change I want to set dropdown width to maximum width of the element and also align position of dropdown properly.
[HostComponent("spark.components.ComboBox")]
]]>
</fx:Metadata>
<fx:Script fb:purpose="styling">
<![CDATA[
private var paddingChanged:Boolean;
private var cornerRadiusChanged:Boolean;
private var cornerRadius:Number = 0;
static private const contentFill:Array = ["bgFill"];
override public function get contentItems():Array { return contentFill };
override protected function commitProperties():void
{
super.commitProperties();
if (paddingChanged && textInput)
{
var padding:Number;
padding = getStyle("paddingLeft");
if (textInput.getStyle("paddingLeft") != padding)
textInput.setStyle("paddingLeft", padding);
padding = getStyle("paddingTop");
if (textInput.getStyle("paddingTop") != padding)
textInput.setStyle("paddingTop", padding);
padding = getStyle("paddingRight");
if (textInput.getStyle("paddingRight") != padding)
textInput.setStyle("paddingRight", padding);
padding = getStyle("paddingBottom");
if (textInput.getStyle("paddingBottom") != padding)
textInput.setStyle("paddingBottom", padding);
paddingChanged = false;
}
if (cornerRadiusChanged)
{
cornerRadiusChanged = false;
}
}
override public function styleChanged(styleProp:String):void
{
var allStyles:Boolean = !styleProp || styleProp == "styleName";
super.styleChanged(styleProp);
if (allStyles || styleProp.indexOf("padding") == 0)
{
paddingChanged = true;
invalidateProperties();
}
if (allStyles || styleProp == "cornerRadius")
{
cornerRadiusChanged = true;
invalidateProperties();
}
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
if (getStyle("borderVisible") == false)
{
if (border)
border.visible = false;
if (background)
{
background.left = background.top = background.right = background.bottom = 0;
}
if (scroller)
scroller.minViewportInset = 0;
}
else
{
if (border)
border.visible = true;
if (background)
{
background.left = background.top = background.right = background.bottom = 1;
}
if (scroller)
scroller.minViewportInset = 1;
}
if (dropShadow)
dropShadow.visible = getStyle("dropShadowVisible");
if (borderStroke)
{
borderStroke.color = getStyle("borderColor");
borderStroke.alpha = getStyle("borderAlpha");
}
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
]]>
</fx:Script>
<s:states>
<s:State name="normal" />
<s:State name="open" />
<s:State name="disabled" />
</s:states>
<s:PopUpAnchor id="popUp" displayPopUp.normal="false" displayPopUp.open="true" includeIn="open"
left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto"
popUpPosition="below" popUpWidthMatchesAnchorWidth="false">
<s:Group id="dropDown" maxHeight="112" minHeight="22" minWidth="{this.width}">
<s:RectangularDropShadow id="dropShadow" blurX="20" blurY="20" alpha="0.45" distance="7"
angle="90" color="#000000" left="0" top="0" right="0" bottom="0"/>
<s:Rect id="border" left="0" right="0" top="0" bottom="0">
<s:stroke>
<s:SolidColorStroke id="borderStroke" weight="1"/>
</s:stroke>
</s:Rect>
<s:Rect id="background" left="1" right="1" top="1" bottom="1" >
<s:fill>
<s:SolidColor id="bgFill" color="0xFFFFFF" />
</s:fill>
</s:Rect>
<s:Scroller id="scroller" left="0" top="0" right="0" bottom="0" hasFocusableChildren="false" minViewportInset="1">
<s:DataGroup id="dataGroup" itemRenderer="spark.skins.spark.DefaultItemRenderer">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="contentJustify" requestedMinRowCount="1" requestedMaxRowCount="6"/>
</s:layout>
</s:DataGroup>
</s:Scroller>
</s:Group>
</s:PopUpAnchor>
<s:Button id="openButton" width="19" right="0" top="0" bottom="0" focusEnabled="false"
skinClass="spark.skins.spark.ComboBoxButtonSkin" tabEnabled="false" />
<s:TextInput id="textInput" enabled.disabled="false"
left="0" right="18" top="0" bottom="0"
skinClass="spark.skins.spark.ComboBoxTextInputSkin"/>
Whenever dataprovider changes on combobox text input change,has to use this code, to set position of dropdown in combobox.
LayoutManager.getInstance().validateNow();
(this.skin as ComboBoxSkin).popUp.updatePopUpTransform();
I meet a problem when migrate the application for flex 3.5 to flex 4.5. The char style cannot be apply correctly when set the style in application, it still use columnChart default style. But when I move the fx:Style declaration to ColumnchChartModule, the char style works. Could someone help me to explain why the style inheriting is broken?
BTW: the button style seems working, when I define a button style in application.
Below is my test code:
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Style>
#namespace s "library://ns.adobe.com/flex/spark";
#namespace mx "library://ns.adobe.com/flex/mx";
.c01 {
fill: #0D7393;
areaFill: #0D7393;
}
.c02 {
fill: #A1B26B;
areaFill: #A1B26B;
}
.c03 {
fill: #C4843D;
areaFill: #C4843D;
}
.c04 {
fill: #5A4736;
areaFill: #5A4736;
}
.c05 {
fill: #994C34;
areaFill: #994C34;
}
.c06 {
fill: #649DA2;
areaFill: #649DA2;
}
.c07 {
fill: #D66D2B;
areaFill: #D66D2B;
}
.c08 {
fill: #C8E8B0;
areaFill: #C8E8B0;
}
.c09 {
fill: #6BB9D3;
areaFill: #6BB9D3;
}
mx|ColumnChart {
chartSeriesStyles: c01, c02, c03, c04, c05, c06, c07, c08, c09;
}
s|Button{
color: red;
}
</fx:Style>
<s:layout>
<s:VerticalLayout />
</s:layout>
<mx:ModuleLoader url="ColumnChartModule.swf" width="100%" height="100%"/>
---------------------------------------- ColumnChartModule.mxml
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%">
<fx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"Jan", Revenue:1200, Expenses:500},
{Month:"Feb", Revenue:1200, Expenses:550},
{Month:"Mar", Revenue:1240, Expenses:475},
{Month:"Apr", Revenue:1300, Expenses:600},
{Month:"May", Revenue:1420, Expenses:575},
{Month:"Jun", Revenue:1400, Expenses:600},
{Month:"Jul", Revenue:1500, Expenses:600},
{Month:"Aug", Revenue:1600, Expenses:750},
{Month:"Sep", Revenue:1600, Expenses:735},
{Month:"Oct", Revenue:1750, Expenses:750},
{Month:"Nov", Revenue:1800, Expenses:800},
{Month:"Dec", Revenue:2000, Expenses:850}
]);
private function onClick(): void{
var columnChart:CSSStyleDeclaration = this.styleManager.getStyleDeclaration("mx|ColumnChart");
var columnChart1:CSSStyleDeclaration = this.styleManager.getMergedStyleDeclaration("mx|ColumnChart");
var columnChart2:CSSStyleDeclaration = this.styleManager.getStyleDeclaration("s|Button");
trace(columnChart);
trace(columnChart1);
trace(columnChart2);
}
]]></fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:Button label="GetChartStyle" click="onClick()" />
<s:Panel title="Floating Column Chart">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<mx:ColumnChart
dataProvider="{expenses}"
showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{expenses}"
categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries
yField="Revenue"
displayName="Revenue"/>
<mx:ColumnSeries
yField="Expenses"
displayName="Expenses"/>
</mx:series>
</mx:ColumnChart>
</s:Panel>
On your module ie. MyCustomModule.mxml put this override code.
override public function get moduleFactory():IFlexModuleFactory{
return FlexGlobals.topLevelApplication.moduleFactory;
}
Unable to use "HelveticaLtEx" font.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%" height="100%" fontFamily="Arial" fontSize="12"
xmlns:ilog="http://www.ilog.com/2007/ilog/flex"
xmlns:local="c7.views.apps.calendar.*"
backgroundColor="#FFFFFF">
<mx:Style>
#font-face {
src:url("assets/cloud_main/font/HelveticaNeueLTStd-LtEx.otf");
fontFamily: HelveticaLtEx;
}
.dateStyle{
font-family: "HelveticaLtEx";
fontSize: 18;
}
</mx:Style>
<mx:Canvas>
<mx:VBox>
<mx:Label text="testing testing testing" styleName="dateStyle"/>
</mx:VBox>
</mx:Canvas>
</mx:Application>
The bold and italics properties must match the properties of the font itself.
Try these styles and see what happens :
.dateStyle{
font-family: "HelveticaLtEx";
fontSize: 18;
fontWeight:bold;
}
Or :
.dateStyle{
font-family: "HelveticaLtEx";
fontSize: 18;
fontStyle:italic;
}
Or :
.dateStyle{
font-family: "HelveticaLtEx";
fontSize: 18;
fontWeight:bold;
fontStyle:italic;
}
It will work for you, if not, let me know and we'll try something else...
protected function lbHideQuery_clickHandler(event:MouseEvent):void
{
if (lbHideQuery.selected)
{
lbHideQuery.label = "Show Query Panel";
origHeight = canvas1.height;
canvas1.height = 0;
}
else
{
lbHideQuery.label = "Hide Query Panel";
canvas1.height = origHeight;
}
}
]]>
</mx:Script>
<mx:LinkButton label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<mx:Canvas id="canvas1" width="100%" height="20%" backgroundColor="0x353356">
<mx:VBox width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
<mx:Button label="Button 1"/>
<mx:Button label="Button 2"/>
<mx:Button label="Button 3"/>
</mx:VBox>
but in Flex 4 when the BorderContainer collapses the buttons are still visible.
}
}
]]>
</fx:Script>
<mx:LinkButton label="Hide Query Panel" id="lbHideQuery" toggle="true" click="lbHideQuery_clickHandler(event)"/>
<s:BorderContainer width="100%" height="25%" backgroundColor="0x353356" id="bc1" >
<s:layout>
<s:HorizontalLayout paddingLeft="6"/>
</s:layout>
<s:VGroup width="16%" height="90" minHeight="0" minWidth="0" id="vgbtns">
<s:Button label="Button 1"/>
<s:Button label="Button 2"/>
<s:Button label="Button 3"/>
</s:VGroup>
</s:BorderContainer>
if (lbHideQuery.selected)
{
lbHideQuery.label = "Show Query Panel";
origHeight = canvas1.height;
canvas1.height = 0;
canvas1.visible= false;
}
else
{
lbHideQuery.label = "Hide Query Panel";
canvas1.height = origHeight;
canvas1.visible= true;
}