Popa Mihai

PopaMihai.com – Flex, Flash, AIR and ActionScript articles and tutorials

Archive for the ‘CSS’ tag

Fixing Anti-Alias and Sharpness Problems With Embedded Fonts

leave a comment

Most of the times when you embed a font in Flex the font won’t look exactly how you want it. Flex offers 4 FlashType style properties that can be used to improve the appearance of the embedded fonts in your applications. There properties are fontAntiAliasType, fontGridFitType, fontSharpness, and fontThickness.

  • fontAntiAliasType sets the antiAliasType property and can have two values: nomal or advanced
  • fontGridFitType sets the gridFitType property and can have three values: none, pixel, and subpixel
  • fontSharpness sets the sharpness property and can take values between -400 and 400
  • fontThickness sets the thickness property and can take values between -200 and 200

Read the rest of this entry »

Written by Popa Mihai

August 12th, 2009 at 3:01 pm

Posted in Flex

Tagged with ,

Reduce the Size of SWF by Using Character Ranges for Embedded Fonts

leave a comment

When you embed fonts in you Flex applications most of the time the size of the application will increase with up to 400K.

In most cases you can reduce the size of the resulting SWF by embedding only the characters that will actually be used in the application. There is no point in embedding numbers and punctuation if you only use a-z and A-Z letters in your application. This is particularly useful when the embedded font is only used in the title of the application or on some fancy buttons which don’t use numbers or punctuation.

To do this you must specify the character ranges when embedding the font with CSS by using the unicodeRange property.
Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 3:31 pm

Posted in Flex

Tagged with , ,

How to Embed Fonts in a Flex Application – method 2

leave a comment

This example shows another method you could use to embed fonts in Flex.

Usually when you embed fonts in Flex you use CSS. Here is how to embed fonts in a Flex Application with CSS.

In this example I will use the [Embed] tag to embed the fonts in Flex. Here is how this is done:
Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 12:07 pm

Posted in Flex

Tagged with ,

How to Embed Fonts in a Flex Application – method 1

one comment

In this example I will embed two fonts in Flex: one that is installed on the local computer and one from a specified URL.

In this example I used CSS to embed fonts in Flex. When you embed the font in Flex you must specify the source and the fontFamily. Here is the syntax used to embed a font in Flex using CSS, when the font is already installed on the computer:

		@font-face {
			src: local("Courier New");
			fontFamily: CourierEmbedded;
		}

Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 11:59 am

Posted in Flex

Tagged with ,

Customizing the Appearance of the Flex Vertical Slider – VSlider

leave a comment

This example shows how to customize the appearance of the Flex VSlider, by changing the data tip appearance, using a custom image to skin the thumb and the track images and more.

Here is an image of what the application will achieve:

Custom Vertical Slider Skin For The VSlider Class
Read the rest of this entry »

Written by Popa Mihai

August 10th, 2009 at 8:38 pm

Posted in Flash,Flex,Styling Components

Tagged with ,

Customizing the Appearance of the Flex Horizontal Slider – HSlider

leave a comment

This example shows how to customize the appearance of the Flex HSlider, by changing the data tip appearance, using a custom image to skin the thumb and the track images and more.

Here is an image of what the application will achieve:

Custom Horizontal Slider Skin For The HSlider Class
Read the rest of this entry »

Written by Popa Mihai

August 10th, 2009 at 3:28 pm

Posted in Flash,Flex,Styling Components

Tagged with ,

Customizing the Appearance of the Flex Vertical Scroll Bar – VScrollBar

leave a comment

The following example will use custom images to customize the appearance of the Flex Vertical Scroll Bar (VScrollBar).

First I created the art work for the custom VScrollBar. The elements that this example changes are: downArrow, upArrow, thumb and the track.

This is how the finished custom VScrollBar will appear:

Custom Vertical Scroll Bar Skin For The VScrollBar Class
Read the rest of this entry »

Written by Popa Mihai

August 10th, 2009 at 12:22 pm

Posted in Flash,Flex,Styling Components

Tagged with ,

Customizing the Appearance of the Flex Horizontal Scroll Bar – HScrollBar

leave a comment

The following example will use custom images to customize the appearance of the Flex Horizontal Scroll Bar (HScrollBar).

First I created the art work for the custom HScrollBar. The elements that this example changes are: downArrow, upArrow, thumb and the track.

This is how the finished custom HScrollBar will appear:

Custom Horizontal Scroll Bar Skin For The HScrollBar Class
Read the rest of this entry »

Written by Popa Mihai

August 9th, 2009 at 1:44 pm

Posted in Flash,Flex,Styling Components

Tagged with ,

Customizing the Appearance of the Flex RadioButton using Flash CS3

one comment

The default Flex controls look pretty good, but in most situations you will want to add custom graphics to your Flex applications. The following example will use a custom skin made with Flash CS3 to customize the appearance of the Flex RadioButton.

The steps that you must take are pretty straight forward:

  1. Create the art work with Flash for the up, down, over, selectedUp, selectedDown, selectedOver states for the custom RadioButton
  2. Convert the artwork to symbols and export them for ActionScript
  3. Use the resulting SWF in a Flex application to create a custom Flex RadioButton

Read the rest of this entry »

Written by Popa Mihai

August 7th, 2009 at 1:29 pm

Posted in Flash,Flex,Styling Components

Tagged with ,

Creating a Custom Flex Button Skin Using Flash CS3

leave a comment

This short example will show how you can use Flash CS3 Professional to create a custom skin that you can then use to create a custom button for your Flex applications.

The steps that we will take:

  1. Create the art work with Flash for the up, down, over and disabled states for the custom button
  2. Convert the artwork to symbols and export them for ActionScript
  3. Use the resulting SWF in a Flex application to create a custom Flex Button

Read the rest of this entry »

Written by Popa Mihai

August 6th, 2009 at 12:45 am

Posted in Flash,Flex,Styling Components

Tagged with ,