String.fromCharCode()

Actionscript:
  1. [SWF(height = 950, width=1000)]
  2. var txt:TextField;
  3. var num:int = 0;
  4. for (var i:int = 0; i<761; i++){
  5.     if (i % 76 == 0){
  6.          makeTxt(num);
  7.          num++;
  8.     }
  9.     if (i <0x21){
  10.         txt.appendText("-\n");
  11.     }else{
  12.         txt.appendText(String.fromCharCode(i) + " = " +  i + "\n");
  13.     }
  14. }
  15. function makeTxt(num:Number):void{
  16.      txt= TextField(addChild(new TextField()));
  17.      txt.x = 10 + num * 100;
  18.      txt.y = 10;
  19.      txt.height = 930;
  20.      txt.text = "";
  21. }

This will draw a few columns of char codes.

This entry was posted in strings and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*