Home Tutorial Flex Flex4 Components SstyleName property example in Flex4

 
 

Share on Google+Share on Google+
SstyleName property example in Flex4
Posted on: June 1, 2010 at 12:00 AM
Advertisement
If user want to apply the style properties in a single component then user use styleName properties for particular component.

StyleName Property for Style in Flex4:-

If user want to apply the style properties in a single component then user use styleName properties for particular component.

Example:-

<?xml version="1.0"?>

<s:Application

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

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

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

<fx:Style>

.textFontStyle {

fontSize: 15;

color: #00CCFF;

font-weight:bold;

font-thickness:10;

}

</fx:Style>

<s:VGroup>

<mx:Text id="text1" text="This is text control with Style in Flex4." styleName="textFontStyle"/>

<mx:Text id="text2" text="This is text control without Style in Flex4."/>

</s:VGroup>

</s:Application>

In this example we have create two text components one is with styleName property and other is without styleName property. And create a style class name is textFontStyle, which is include font  related properties and color for the text. User can see these style class apply for the components that use styleName property and other text component are create simply without style.

Output:-strong>

Download this code

Advertisement

Related Tags for SstyleName property example in Flex4:


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.

Posted on: June 1, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com