Tag Archive for 'stylemanager'

22
Apr

Setting the letter spacing in the RichTextEditor control in Flex

The following example shows how you can set the letter spacing in a Flex RichTextEditor control by setting the textAreaStyleName and letterSpacing styles.

Full code after the jump.

Continue reading ‘Setting the letter spacing in the RichTextEditor control in Flex’

12
Dec

Loading cascading style sheets on the fly using the Flex StyleManager class

The following example shows how you can dynamically load a cascading style sheet SWF into your Flex application using the static StyleManager.loadStyleDeclarations() method.

Full code after the jump.

Continue reading ‘Loading cascading style sheets on the fly using the Flex StyleManager class’

13
Nov

Changing default line colors in a Flex LineChart control

The following example shows how you can change the line colors in a LineChart in Flex by setting the lineStroke style in MXML or ActionScript, as seen in the following snippets:

MXML:

<mx:LineSeries id="closeSeries" yField="@close" form="curve" displayName="Close">
    <mx:lineStroke>
        <mx:Stroke color="haloGreen" weight="2" alpha="0.6" />
    </mx:lineStroke>
</mx:LineSeries>

ActionScript:

<mx:LineSeries id="closeSeries" yField="@close" form="curve" displayName="Close" />
...
closeSeries.setStyle("lineStroke", new Stroke(0xFF0000, 2, 0.4));

Full code after the jump.

Continue reading ‘Changing default line colors in a Flex LineChart control’

13
Sep

Changing text alignment in an Flex Accordion header

The following example shows how you can use the textAlign style to control the text alignment of a label in an Accordion header.

Full code after the jump.

Continue reading ‘Changing text alignment in an Flex Accordion header’

13
Sep

Checking whether a color name is a valid color in Flex using the StyleManager class

The following example shows how to use the static StyleManager.isColorName() method to check whether a color name is valid or not. This method takes a single parameter, colorName, and returns a Boolean value representing whether the parameter is a valid alias for a color.

Full code after the jump.

Continue reading ‘Checking whether a color name is a valid color in Flex using the StyleManager class’

12
Sep

Building a simple style browser in Flex 3

In my previous post, “Introducing the StyleManager.selectors property in Flex 3“, we looked at the new StyleManager class’s static selectors property introduced in Flex 3.

This example shows how you can make a simple app which lets you loop over styles currently registered with the StyleManager and display their current style names and values.

Full code after the jump.

Continue reading ‘Building a simple style browser in Flex 3′

12
Sep

Introducing the StyleManager.selectors property in Flex 3

I was testing this today, and thought some people might find it useful. In more recent builds of the Flex 3 SDK, the StyleManager now includes a new static, read-only property, selectors. To quote the bug notes:

…This property returns an array of strings representing all of the selectors registered with the StyleManager.

For more information check out the bug at “[SDK-11706] Expose All Existing Styles via StyleManager”, and download a recent nightly build of the Flex 3 SDK at “Adobe Labs - Flex 3 Software Developement Kit”.

And as always, you can read the source code for the StyleManager class by extracting the SDK ZIP file and going to: “[flex_sdk_3.zip]\frameworks\projects\framework\src\mx\styles\StyleManager.as”.

The following example shows how you can use the new static selectors property in the Flex 3 StyleManager class to display a list of selectors currently registered with the style manager.

Full code after the jump.

Continue reading ‘Introducing the StyleManager.selectors property in Flex 3′

06
Sep

Converting color names to numbers using the StyleManager class

The following examples show how you can convert color names (such as “red”, “haloSilver”, “#FFFFFF”, and “0xFFFF00″) into numeric values, using the StyleManager class’s static getColorName() method and getColorNames() method.

Full code after the jump.

Continue reading ‘Converting color names to numbers using the StyleManager class’