String.fromCharCode()

[SWF(height = 950, width=1000)]
var txt:TextField;
var num:int = 0;
for (var i:int = 0; i<761; i++){
	if (i % 76 == 0){
		 makeTxt(num);
		 num++;
	}
	if (i < 0x21){
		txt.appendText("-n");
	}else{
	    txt.appendText(String.fromCharCode(i) + " = " +  i + "n");
	}
}
function makeTxt(num:Number):void{
	 txt= TextField(addChild(new TextField()));
     txt.x = 10 + num * 100;
     txt.y = 10;
     txt.height = 930;
     txt.text = "";
}

This will draw a few columns of char codes.

Leave a Reply

Your email address will not be published. Required fields are marked *