Using CSS (Cascading Style Sheets) in Action Script - Helper class (for TextField, Label Control, or other text control)
This is a helper class for using Cascading Style Sheets for the assignment of different properties with CSS.
import flash.text.*;
import fl.controls.*
var ss:StyleSheet = new StyleSheet();
s.parseCSS(".lblStyle{ font-size:12;font-family: Arial;color:#000000; } .textFieldStyle{font-size:12;font-family: Arial;color:#FF0000;}")
var lbl:Label = new Label();
CssHelper.setStyle(lbl.textField, ss, ".lblStyle");
var tf:TextField = new TextField();
CssHelper.setStyle(tf, ss, ".textFieldStyle");
This is a sample CSS that you could store in an XML file: