topical media & game development
flex-led-char.mx
flex-led-char.mx
[swf]
flex
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="10" height="30">
<mx:Script>
<![CDATA[
public static const DISPLAY_7_SEG:uint = 0;
public static const DISPLAY_14_SEG:uint = 1;
public static const DISPLAY_16_SEG:uint = 2;
//standard A-G segments for 7seg display (see wikipedia)
private var segA:Boolean;
private var segB:Boolean;
private var segC:Boolean;
private var segD:Boolean;
private var segE:Boolean;
private var segF:Boolean;
private var segG:Boolean;
//extra segments for 14 and 16 segment display
//ie the middle verticals and diagonals
private var segH:Boolean;
private var segI:Boolean;
private var segJ:Boolean;
private var segK:Boolean;
private var segL:Boolean;
private var segM:Boolean;
//segments that are split into 2 in the 14 and/or 16 segment display
//ie. A, D, and G. These segments represent the 2 halves of each segment
private var segA1:Boolean;
private var segA2:Boolean;
private var segD1:Boolean;
private var segD2:Boolean;
private var segG1:Boolean;
private var segG2:Boolean;
private var segDP:Boolean; //decimal point
private var segP1:Boolean; //points that make up the ':' symbol
private var segP2:Boolean;
public var displayType:uint = DISPLAY_16_SEG;
public var thickness:int = 3;
public var gap:int = 1;
public var onColor:uint = 0xFF0000;
public var offColor:uint = 0x330000;
public var alwaysDrawDots:Boolean = false;
private static var mappings:Array = [];
mappings["0"] = 63;
mappings["1"] = 6;
mappings["2"] = 91;
mappings["3"] = 79;
mappings["4"] = 102;
mappings["5"] = 109;
mappings["6"] = 125;
mappings["7"] = 7;
mappings["8"] = 127;
mappings["9"] = 111;
//require 14 or 16 seg
mappings["A"] = 119;
mappings["B"] = 387343;
mappings["C"] = 57;
mappings["D"] = 125199;
mappings["E"] = 254009;
mappings["F"] = 155697;
mappings["G"] = 385085;
mappings["H"] = 118;
mappings["I"] = 2313;
mappings["J"] = 35073;
mappings["K"] = 132656;
mappings["K"] = 132656;
mappings["L"] = 56;
mappings["M"] = 694;
mappings["N"] = 1206;
mappings["O"] = 63;
mappings["P"] = 115;
mappings["Q"] = 1087;
mappings["R"] = 1139;
mappings["S"] = 109;
mappings["T"] = 2305;
mappings["U"] = 62;
mappings["V"] = 4656;
mappings["W"] = 5174;
mappings["X"] = 5760;
mappings["Y"] = 4736;
mappings["Z"] = 4617;
mappings["
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.