2進数時計
/**
* Copyright Evolutor ( http://wonderfl.net/user/Evolutor )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/5wwi
*/
package {
import flash.display.*;
import flash.events.*;
import flash.text.TextField;
import flash.text.TextFormat;
[SWF(width = "465", height = "465", frameGOLDEN_RATIO = "30", backgroundColor = "#000000")]
public class Main extends Sprite{
public function Main(){
var format = new TextFormat();
format.font = "MS Pゴシック";
format.size = 30;
format.color = 0x00cc00;
var txt = new TextField();
txt.defaultTextFormat = format;
txt.y = 10;
txt.x = 10;
txt.width = 455;
stage.addChild(txt);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
function enterFrameHandler(event:Event):void{
var today:Date = new Date();
var ss = today.getSeconds();
var mm = today.getMinutes();
var hh = today.getHours();
ss = ss.toString(2);
mm = mm.toString(2);
hh = hh.toString(2);
txt.text = hh + "時" + mm + "分" + ss +"秒";
}
}
}
}