Mr.Kennedy
11-24-2008, 01:10 PM
Hello everyone, well im pretty pretty new to AS3 world. Im not a great mind for programming so everything i do takes me a lot of time to figure it out.
Scenerio: I have a List Component, and i need to use an embed font on the list. So far i figured out how to format most of the List Component using a Custom CellRenderer like this:
package {
import fl.controls.listClasses.CellRenderer;
import flash.text.TextFormat;
import flash.filters.BevelFilter;
import flash.text.TextField;
public class CustomCellRenderer extends CellRenderer {
public function CustomCellRenderer() {
var format:TextFormat = new TextFormat();
format.font = "capitan"; // this is the font name imported to library
format.size = 16;
format.leftMargin = 18;
setStyle("textFormat", format);
}
}
}
called CustomCellRenderer.as
and i have my .fla file with a List Component on stage (instance name: playList). with this code in the first frame to get the style from the .as file:
playList.setStyle("cellRenderer", CustomCellRenderer);
playList.rowHeight = 30;
playList.setStyle("embedFonts", true);
So far, it does in fact format the text on the list, but it doesnt use the embed font. What im missing on this situation?.
Thanks in adv!.
Scenerio: I have a List Component, and i need to use an embed font on the list. So far i figured out how to format most of the List Component using a Custom CellRenderer like this:
package {
import fl.controls.listClasses.CellRenderer;
import flash.text.TextFormat;
import flash.filters.BevelFilter;
import flash.text.TextField;
public class CustomCellRenderer extends CellRenderer {
public function CustomCellRenderer() {
var format:TextFormat = new TextFormat();
format.font = "capitan"; // this is the font name imported to library
format.size = 16;
format.leftMargin = 18;
setStyle("textFormat", format);
}
}
}
called CustomCellRenderer.as
and i have my .fla file with a List Component on stage (instance name: playList). with this code in the first frame to get the style from the .as file:
playList.setStyle("cellRenderer", CustomCellRenderer);
playList.rowHeight = 30;
playList.setStyle("embedFonts", true);
So far, it does in fact format the text on the list, but it doesnt use the embed font. What im missing on this situation?.
Thanks in adv!.