Class TextFormat problem

I’m trying to understand the properties of the TextFormat class.


var sir:TextFormat = new TextFormat("Acesta e un exemplu");

trace(sir.align=TextFormatAlign.RIGHT);
sir.font="Arial";

In the code above I defined my variable sir of type TextFormat (sir is an instance of the class TextFormat). What I want to do is to experiment some of the properties for that class.

In the example above I want to make the string of type textformat class arial , align him to right, block indent=10, style bold etc.

I made a switch here because I understood that function but I don’t know how to integrate this to my first 2 lines of code to complete understand all properties of class TextFormat. Can you help me pls?


switch(line) {
                    case "align":
                        newFormat.align = TextFormatAlign.RIGHT;
                        break;
                    case "blockIndent":
                        newFormat.blockIndent = 10;
                        break;
                    case "bold":
                        newFormat.bold = true;
                        break;
                    case "bullet":
                        newFormat.bullet = true;
                        break;
                    case "color":
                        newFormat.color = 0xFF0000;        
                        break;
                    case "font":
                        newFormat.font = "Arial";
                        break;
                    case "indent":
                        newFormat.indent = 20;
                        break;
                    case "italic":
                        newFormat.italic = true;
                        break;
                    case "leading":
                        newFormat.leading = 5;
                        break;
                    case "leftMargin":
                        newFormat.leftMargin = 20;
                        break;
                    case "letterSpacing":
                        newFormat.letterSpacing = 4;
                        break;
                    case "rightMargin":
                        newFormat.rightMargin = 20;
                        break;
                    case "size":
                        newFormat.size = 16;
                        break;
                    case "tabStops":                
                        newFormat.tabStops = [50, 150];
                        break;
                    case "target":
                        newFormat.url = "http://www.adobe.com/products/flex/";    
                        newFormat.target = "_blank";
                        break;    
                    case "underline":
                        newFormat.underline = true;
                        break;
                    case "url":
                        newFormat.url = "http://www.adobe.com/products/flex/";    
                        break;