led数字源码
[sourcecode]
function setD(digit:String)
{
var bits:int = 0;
switch (digit)
{
case "0" :
bits = 0x3F;
break;
case "1" :
bits = 0x14;
break;
case "2" :
bits = 0x6d;
break;
case "3" :
bits = 0x75;
break;
case "4" :
bits = 0x56;
break;
case "5" :
bits = 0x73;
break;
case "6" :
bits = 0x7B;
break;
case "7" :
bits = 0x15;
break;
case "8" :
bits = 0x7F;
break;
case "9" :
bits = 0x77;
break;
case "e" :
bits = 0x6B;
break;
case "+" :
bits = 0x50;
break;
case "-" :
bits = 0x40;
break;
case "" :
bits = 0x00;
break;
}
top.visible = (bits & 1) == 1 ? true:false;
top_left.visible = (bits & 2) == 2 ? true:false;
top_right.visible = (bits & 4) == 4 ? true:false;
bottom_left.visible = (bits & 8) == 8 ? true:false;
bottom_right.visible = (bits & 16) == 16 ? true:false;
bottom.visible = (bits & 32) == 32 ? true:false;
middle.visible = (bits & 64) == 64 ? true:false;
}
[/sourcecode]