The web site for Flash ActionScript 3.0 game developers

 
         
   

Memory game - adding embedded text from Library

Hi All,

In the matching game I added the following to get the game to work with the embedded font in the library.

// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new AdLibBT();

public function MemoryGame() {
// text formating
var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
myFormat.size = 24;
myFormat.align = "center";

// create the upper text field
textMessage = new TextField();
textMessage.width = 700;
textMessage.y = 50;
textMessage.selectable = false;
textMessage.defaultTextFormat = myFormat;
addChild(textMessage);

It works on in the matching game but in the memory game the screen displays times new Roman instead of Ad lib. Can anyone suggest a reason.

All the best



Copyright Gary Rosenzweig