flash on 2012-11-8
/**
* Copyright hucota7 ( http://wonderfl.net/user/hucota7 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7Wip
*/
package {
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.text.TextFormat;
import flash.text.TextField;
import flash.text.engine.TextLine;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
var bg:Sprite = new Sprite();
addChild(bg);
bg.graphics.beginFill(0x101010);
bg.graphics.drawRect(0,0,260,260);
var tick:int = 0;
//var timer:Timer = new Timer(41+(2/3));
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER,timerFunc);
timer.start();
function timerFunc(e:TimerEvent):void
{
tick++;
words.text = tick.toString();
}
for (var i:int=0;i<25;i++)
{
for (var j:int=0;j<25;j++)
{
if (true)
{
var square:Sprite = new Sprite();
addChild(square);
if ((i+j) % 2)
square.graphics.beginFill(0x484848);
else
square.graphics.beginFill(0x505050)
square.graphics.drawRect(5,5,10,10);
square.graphics.endFill();
square.x = i*10;
square.y = j*10;
}
}
}
var format:TextFormat = new TextFormat();
format.font = "Small fonts";
format.size = 10;
var words:TextField = new TextField();
words.selectable = false;
words.defaultTextFormat = format;
words.wordWrap = true;
words.text = tick.toString();
words.width = 250;
words.height = 250;
words.x = 5;
words.y = 5;
addChild(words);
}
}
}