Flex Tutorials

Broken Image Skin

Written by Administrator

brokenImageSkin in Flex

In Flex you have an Image showing a broken image link if you have not set an image on it. How do you get it to not show the broken image link? You do this by setting the broken image skin, you can also sent the broken image skin to null. The mx:Image then does not show the broken image link.

 

1
 id="backgroundImage" brokenImageSkin="{null}" />

 

 

 

Flex Embed Font

Written by Philip

Website / Blog : www.how-to-code.com

Contact : This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Embed a Local Font from CSS

To Embed a local font in Flex using CSS you will first need to create your CSS file. Once created specify your local font using the following @font-face. And say you wish to access your embeded font from the CSS use font-family:ArialEmbed to access it.

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
@font-face{
src:local("Arial");
font-family:ArialEmbed;
font-weight:bold;
}
 
/** To access the font use font-family:ArialEmbed; **/
 
.mainButtonStyle{
skin:ClassReference(null);
font-family:ArialEmbed;
text-roll-over-color:#990000;
font-size:16;
}

 

 

 

Flex Hand Cursor

Written by Philip

Make a Flex Hand Cursor Appear Perhaps on a Label or Image etc.

To make a Flex Hand Cursor appear on something like an or , try the following from the MXML. useHandCursor="true" mouseChildren="false" buttonMode="true".
.

   

Flex Datagrid Remove Headers

Website / Blog :  www.how-to-code.com

Contact :  This e-mail address is being protected from spambots. You need JavaScript enabled to view it

To remove the headers from a Flex Datagrid set the showHeaders property to False. i.e. showHeaders="false".

 

Flex Trim String

Written by Philip

To trim a String in Flex you'll need to use StringUtil.trim , this allows you to basically take the spaces off the end of a string.

Remember you'll need to import mx.utils.StringUtil; so your code should look like as follows.


2
3
4
var stringWithSpacesOnEnd:String = "hello      ";
stringWithSpacesOnEnd = StringUtil.trim(stringWithSpacesOnEnd);
//stringWithSpacesOnEnd will now not be "hello " but "hello"
//As we've just trimed the string.
If your looking for a nice StringUtil class that you can use try the AS3 String Utils class on gskinner.com at
   

Page 1 of 2