Share on Google+Share on Google+

Font in Flex4

Advertisement
In this example you can see how we can use font in a flex application.

Font in Flex4:

In this example you can see how we can use font in a flex application. You will use font for the appearance of the component. You will use font for give a color , size and etc.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<!-- using fonts -->

<fx:Style>

@namespace s "library://ns.adobe.com/flex/spark";

@namespace mx "library://ns.adobe.com/flex/mx";

s|VGroup{

font-family:Helvetica;

font-size:18px;

color:#808080;

}

s|HGroup{

font-family:Verdana;

font-size:14px;

color:#990000;

}

</fx:Style>

<s:Panel title="Font Example" width="268" height="145">

<s:VGroup x="15" y="13" width="189" height="48">

<s:Button label="Submit"/>

<s:Label text="This is a Helvetica font."/>

</s:VGroup>

<s:HGroup x="14" y="75">

<s:Button label="Submit"/>

<s:Label text="This is a Verdana font."/>

</s:HGroup>

</s:Panel>

</s:Application>

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisements

Posted on: June 23, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.