Prev | Current Page 827 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Lib.current.createEmptyMovieClip(???board???, 1);
board.onMouseUp = onMouseUp;
}
board.clear();
board.lineStyle(linewidth, linecolor, 100);
board.moveTo(offset+side, offset);
board.lineTo(offset+side, offset+side*3);
board.moveTo(offset+side*2, offset);
board.lineTo(offset+side*2, offset+side*3);
board.moveTo(offset, offset+side);
board.lineTo(offset+side*3, offset+side);
board.moveTo(offset, offset+side*2);
board.lineTo(offset+side*3, offset+side*2);
for(r in 0...3)
for(c in 0...3)
switch(g[r][c])
{
case 1: // player one
drawCross(r, c);
case -1: // player two
drawCircle(r, c);
default:
continue;
}
}
private var tf : flash.TextField;
public function message(s : String) : Void
{
if(tf == null)
{
tf = flash.Lib.current.createTextField(???tf???, 2, 0,
side*3+offset*2, side*3+offset*2, fontsize*2+12);
tf.multiline = tf.wordWrap = true;
tf.setNewTextFormat(new flash.TextFormat(fontname, fontsize,
fontcolor, true, false, false, null, null, ???center???));
}
tf.text = s;
}
(continued)
Chapter 15: Putting It All Together with haXe Remoting
449
private function onMouseUp()
{
if(ended)
server.


Pages:
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839