Home Tutorial Flex Flex4 Components SstyleName property example in Flex4

 
 

SstyleName property example in Flex4
Posted on: June 1, 2010 at 12:00 AM
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

Related Tags for SstyleName property example in Flex4:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.