Share on Google+Share on Google+

Style through namespace in Flex4

Ads
In this example we have apply style property through corresponding components.

Style in Flex4 through <fx:Style> tag:-

In this example we have apply style property through corresponding components. User can see we have create Text and Link button components and create style for a particular components in the <fx:Style> tag. If user want to apply this process for components it is used namespace for the related library.

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>

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

mx|Text {

fontSize: 12;

color: green;

}

mx|LinkButton {

fontSize: 12;

color: #00CCFF;

}

</fx:Style>

<s:VGroup>

<mx:Text text="This is text control in Flex4."/>

<mx:LinkButton label="My Link Button"/>

</s:VGroup>

</s:Application>

Output:-

In this example we have create a text and link button and create corresponding class for these components. These styles are applies all the text and link button components in the application.

Download this code

Advertisements

Posted on: June 1, 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.

Ads

Advertisement