In a previous post on custom cellrenders in Flash CS3 I discussed my trials with replacing the cell contents of a List control with my own creation.
Recently I came up against a problem with using a stock List control. The problem is that the default setting for the textfield antiAliasType is NORMAL which means the type renders in a pre-Flash 8 manner. I want the antiAliasType to be set to ADVANCED to take advantage of the Saffron Type System.
There is a method to style the renderer in a list control:
-
list.setRendererStyle("embedFonts", true);
-
list.setRendererStyle("textFormat", myTextFormat);
The word is that they didn't have time to add "antiAliasType" to this API. The answer to my problem was to use another method that allows a crafty developer to extend CellRenderer and then tell the List to use this class with this line (note: be sure to import your CustomCellRenderer class):
-
list.setStyle("cellRenderer", CustomCellRenderer);
Then in your custom class you need to manually set the anitAliasType of the property "textField"
-
package ca.nait.d3.controls.video {
-
import fl.controls.listClasses.CellRenderer;
-
import flash.text.AntiAliasType;
-
-
public class CustomCellRenderer extends CellRenderer{
-
public function CustomCellRenderer(){
-
textField.antiAliasType = AntiAliasType.ADVANCED;
-
}
-
}
-
}

