Embedding ttf file using CSS in flex 4 and flex 4.5

This post has been moved to http://srinichekuri.com/2011/06/22/embedding-ttf-file-using-css-in-flex4-and-flex4-5/

**********************************************************************

Earlier in flex3 and flex3.5 embedding fonts using  ttf files could be done straight from CSS files, but this was not working for me when I moved to flex 4.  I found a solution in livedocs.

Embedding TTF file in CSS for flex 3 and flex 3.5
/* CSS file */
@font-face
{
     font-family: myFont;
     src: url("/fonts/myFont.ttf");
}

.myStyle
{
    font-family: myFont;
}
Embedding TTF file in CSS for flex 4 and flex 4.5
Step-1:


       [Embed(source='/fonts/myFont.ttf',fontName='myFont',mimeType='application/x-font',embedAsCFF='true')]
       private var font1:Class; //This is only used to compile the code

Step-2:

/* CSS file */
.myStyle
{
    font-family: myFont;
}