[EXAMPLE] MiniClock using PixelScreen
A component that I overlooked until now is the pixelscreen. Here's a little example of using it to display a miniclock
Code:
import km.display.*;
var ps:PixelScreen = new PixelScreen(50,20);
addEventListener(Event.ENTER_FRAME, onFrame);
function onFrame(e:Event):void {
var now:Date = new Date();
hr=now.getHours();
if (hr<10){
hr="0"+hr;
}
min=now.getMinutes();
if(min<10){
min="0"+min;
}
sec=now.getSeconds();
if (sec<10){
sec="0"+sec;
}
ps.cls;
ps.locate(2,1);
ps.print(hr+":"+min+":"+sec);
}
addChild(ps);
ps.color(0xffffff);
box();
function box(){
for (x=3;x<=45;x++){
ps.pset(x,1);
ps.pset(x,15);
}
for (x=2;x<=15;x++){
ps.pset(3,x);
ps.pset(45,x);
}
}