Basicaly im just trying to dynamicaly embed a font.
this is in a separate class…
package Fonts {
public class FontSelect {
[Embed(source = '../Fonts/tahoma.ttf',
fontName = 'TAHOMA',
fontWeight = 'regular',
unicodeRange = 'U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E',
mimeType = 'application/x-font')]
public static const TAHOMA_FONT :Class;
public static const TAHOMA :String = "TAHOMA";
}
}
and here is where i call it in the main.
var myFont:FontSelect = new FontSelect;
var myFormat1:TextFormat = new TextFormat();
myFormat1.align = "center";
myFormat1.font = myFont.TAHOMA;
myFormat1.size = 13;
myFormat1.color = 0xFFFFFF;
i keep getting this error.
Scene 1, Layer ‘actions’, Frame 1, Line 48 1119: Access of possibly undefined property TAHOMA through a reference with static type Fonts:FontSelect.
i assume it has something to do with the static, and when I remove it the program runs, but the font doesn’t appear on top of my button.
uploaded full file, but i couldnot include the tahoma.ttf file, because of the forum file size limit. You can copy said file from the"WINDOWS/FONTS" folder and put it in my projects Fonts folder.*