flash on 2011-5-18
/**
* Copyright puivujhamg ( http://wonderfl.net/user/puivujhamg )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7vrg
*/
package {
import flash.display.Sprite;
import flash.text.*;
public class FlashTest extends Sprite {
private var MynewFormat:TextFormat=new TextFormat();
private var map_array:Array=new Array([0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0]);
public function FlashTest() {
// write as3 code here..
for(var i:int=0;i<5;i++)draw_map();
}
private function draw_map():void {
MynewFormat.size=40;
MynewFormat.color=0x000000;
MynewFormat.align=TextFormatAlign.CENTER;
var show_map:Array=new Array(10);
for (var i:int=0; i<10; i++) {
show_map[i]=new Array(10);
for (var j:int=0; j<10; j++) {
show_map[i][j]=new TextField();
show_map[i][j].text=map_array[i][j];
show_map[i][j].height=show_map[i][j].width=64;
show_map[i][j].x=40*i;
show_map[i][j].y=40*j;
show_map[i][j].setTextFormat(MynewFormat);
addChild(show_map[i][j]);
map_array[i][j]+=1;
}
}
}
}
}