Playing Cards
Felt like making the foundation of a playing card game.
Would rather create the suit symbols with the Graphics class so they would be vectors, but I have no talent for that.
/**
* Copyright PESakaTFM ( http://wonderfl.net/user/PESakaTFM )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/lmoq
*/
package
{
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.events.TimerEvent;
import flash.utils.Timer;
import net.hires.debug.Stats;
[SWF(backgroundColor="#8080FF", frameRate="30", width='465', height='465')]
public class Main extends Sprite
{
private var initTimer:Timer;
public var deck:Deck;
public var card:Card;
public var count:int = 0;
public function Main()
{
addChild(new Stats());
init();
}
private function init():void
{
//Because the Loader.loadBytes is asynchronous I have to make sure
//to let that happen first.
SuitClub.init();
SuitDiamond.init();
SuitHeart.init();
SuitSpade.init();
initTimer = new Timer(100, 1);
initTimer.addEventListener(TimerEvent.TIMER, start);
initTimer.start();
}
private function start(event:TimerEvent):void
{
deck = new Deck();
card = deck.getCard(count);
card.x = 100;
card.y = 15;
addChild(card);
stage.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(event:MouseEvent):void
{
removeChild(card);
count += 1;
if(count >= 52) count %= 52;
card = deck.getCard(count);
card.x = 100;
card.y = 15;
addChild(card);
}
}
}
import flash.text.TextFormat;
import flash.text.TextField;
import flash.display.DisplayObject;
import flash.events.Event;
import flash.display.Graphics;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.geom.Matrix;
import flash.display.Loader;
import flash.utils.ByteArray;
import mx.utils.Base64Decoder;
class Deck
{
private var _cards:Vector.<Card> = new Vector.<Card>( 52, true );
public function Deck()
{
createDeck();
}
public function getCard(num:int):Card
{
return _cards[num];
}
public function shuffle():void
{
var card:Card;
var random:int = 0;
var next:int = _cards.length;
while(--next)
{
random = Math.floor( Math.random() * ( next + 1 ) );
card = _cards[next];
_cards[next] = _cards[random];
_cards[random] = card;
}
}
public function sortByValueFirst():void
{
_cards.sort(_sortByValueFirst);
}
public function sortBySuitFirst():void
{
_cards.sort(_sortBySuitFirst);
}
private function createDeck():void
{
var suit:int = 0;
var value:int = 1;
var type:String;
for( suit=0; suit < 4; suit++ )
{
switch( suit )
{
case 0:
type = SuitTypes.CLUB;
break;
case 1:
type = SuitTypes.DIAMOND;
break;
case 2:
type = SuitTypes.HEART;
break;
case 3:
type = SuitTypes.SPADE;
}
for( value = 1; value <= 13; value++ )
{
_cards[ suit * 13 + value - 1 ] = new Card( type, value );
}
}
}
private function _sortByValueFirst(x:Card, y:Card):Number
{
if(x.value > y.value)
{
// y should appear befor x because it's of a lower value
return 1;
}
else if(x.value < y.value)
{
// x should appear befor y because it's of a lower value
return -1;
}
else if( SuitTypes.orderNumber(x.suit) > SuitTypes.orderNumber(y.suit) )
{
// y should appear befor x because it's suit comes first
return 1;
}
else if( SuitTypes.orderNumber(y.suit) < SuitTypes.orderNumber(x.suit) )
{
// x should appear befor y because it's suit comes first
return -1;
}
return 0;
}
private function _sortBySuitFirst(x:Card, y:Card):Number
{
if( SuitTypes.orderNumber(x.suit) > SuitTypes.orderNumber(y.suit) )
{
// y should appear befor x because it's suit comes first
return 1;
}
else if( SuitTypes.orderNumber(y.suit) < SuitTypes.orderNumber(x.suit) )
{
// x should appear befor y because it's suit comes first
return -1;
}
else if(x.value > y.value)
{
// y should appear befor x because it's of a lower value
return 1;
}
else if(x.value < y.value)
{
// x should appear befor y because it's of a lower value
return -1;
}
return 0;
}
}
class Card extends Sprite
{
private var _suit:String;
public function get suit():String { return _suit; }
private var _value:int;
public function get value():int { return _value; }
private var bmp:Bitmap;
private var bmd:BitmapData;
private static const TOP_Y:Number = 60;
private static const HIGH_MID_HIGH_Y:Number = 93;
private static const MID_HIGH_Y:Number = 105;
private static const LOW_MID_HIGH_Y:Number = 120;
private static const MIDDLE_Y:Number = 150;
private static const LEFT_X:Number = 60;
private static const MIDDLE_X:Number = 105;
private static const RIGHT_X:Number = 150;
private static const NUMBER_Y:Number = 35;
private static const NUMBER_X:Number = 20;
public function Card(suitType:String, value:int)
{
_suit = suitType;
_value = value;
createCard();
}
private function createCard():void
{
bmd = new BitmapData(212, 300, true, 0x00FFFFFF);
var mc:Sprite = new Sprite();
mc.graphics.beginFill(0xFFFFFF, 1);
mc.graphics.lineStyle(1, 0x000000, 1);
mc.graphics.drawRoundRect(0, 0, 211, 299, 15, 15);
mc.graphics.endFill();
bmd.draw(mc);
var color:uint = 0;
var symbol:Sprite;
switch(_suit)
{
case SuitTypes.CLUB:
symbol = SuitClub.symbol;
break;
case SuitTypes.DIAMOND:
color = 0xFF0000;
symbol = SuitDiamond.symbol;
break;
case SuitTypes.HEART:
color = 0xFF0000;
symbol = SuitHeart.symbol;
break;
case SuitTypes.SPADE:
default:
symbol = SuitSpade.symbol;
}
if(_value == 1) // Ace
{
drawSymbol(new SuitAndValue('A', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('A', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y, false, 2);
}
else if(_value == 2)
{
drawSymbol(new SuitAndValue('2', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('2', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, 300-TOP_Y, true);
}
else if(_value == 3)
{
drawSymbol(new SuitAndValue('3', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('3', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y);
drawSymbol(symbol, MIDDLE_X, 300-TOP_Y, true);
}
else if(_value == 4)
{
drawSymbol(new SuitAndValue('4', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('4', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 5)
{
drawSymbol(new SuitAndValue('5', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('5', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 6)
{
drawSymbol(new SuitAndValue('6', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('6', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, LEFT_X, MIDDLE_Y);
drawSymbol(symbol, RIGHT_X, MIDDLE_Y);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 7)
{
drawSymbol(new SuitAndValue('7', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('7', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, MID_HIGH_Y);
drawSymbol(symbol, LEFT_X, MIDDLE_Y);
drawSymbol(symbol, RIGHT_X, MIDDLE_Y);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 8)
{
drawSymbol(new SuitAndValue('8', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('8', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, MID_HIGH_Y);
drawSymbol(symbol, LEFT_X, MIDDLE_Y);
drawSymbol(symbol, RIGHT_X, MIDDLE_Y);
drawSymbol(symbol, MIDDLE_X, 300-MID_HIGH_Y, true);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 9)
{
drawSymbol(new SuitAndValue('9', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('9', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, LEFT_X, LOW_MID_HIGH_Y);
drawSymbol(symbol, RIGHT_X, LOW_MID_HIGH_Y);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y);
drawSymbol(symbol, LEFT_X, 300-LOW_MID_HIGH_Y, true);
drawSymbol(symbol, RIGHT_X, 300-LOW_MID_HIGH_Y, true);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 10)
{
drawSymbol(new SuitAndValue('10', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('10', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, LEFT_X, TOP_Y);
drawSymbol(symbol, RIGHT_X, TOP_Y);
drawSymbol(symbol, MIDDLE_X, HIGH_MID_HIGH_Y);
drawSymbol(symbol, LEFT_X, LOW_MID_HIGH_Y);
drawSymbol(symbol, RIGHT_X, LOW_MID_HIGH_Y);
drawSymbol(symbol, LEFT_X, 300-LOW_MID_HIGH_Y, true);
drawSymbol(symbol, RIGHT_X, 300-LOW_MID_HIGH_Y, true);
drawSymbol(symbol, MIDDLE_X, 300-HIGH_MID_HIGH_Y, true);
drawSymbol(symbol, LEFT_X, 300-TOP_Y, true);
drawSymbol(symbol, RIGHT_X, 300-TOP_Y, true);
}
else if(_value == 11) // Jack
{
drawSymbol(new SuitAndValue('J', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('J', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y, false, 2);
}
else if(_value == 12) // Queen
{
drawSymbol(new SuitAndValue('Q', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('Q', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y, false, 2);
}
else if(_value == 13) // King
{
drawSymbol(new SuitAndValue('K', symbol, color), NUMBER_X, NUMBER_Y, false);
drawSymbol(new SuitAndValue('K', symbol, color), 210-NUMBER_X, 300-NUMBER_Y, true);
drawSymbol(symbol, MIDDLE_X, MIDDLE_Y, false, 2);
}
bmp = new Bitmap(bmd, "auto", true);
addChild(bmp);
}
private function drawSymbol(symbol:Sprite, x:Number, y:Number, flipped:Boolean = false, scale:Number = 1):void
{
var matrix:Matrix = new Matrix();
if(flipped)
{
matrix.rotate(Math.PI);
}
matrix.scale(scale, scale);
matrix.tx = x;
matrix.ty = y;
bmd.draw(symbol, matrix, null, null, null, true);
}
}
class SuitTypes
{
public static const CLUB:String = "club";
public static const DIAMOND:String = "diamond";
public static const HEART:String = "heart";
public static const SPADE:String = "spade";
public static function orderNumber(type:String):int
{
if( type == SuitTypes.CLUB ) return 0;
if( type == SuitTypes.DIAMOND ) return 1;
if( type == SuitTypes.HEART ) return 2;
if( type == SuitTypes.SPADE ) return 3;
return -1;
}
}
class SuitAndValue extends Sprite
{
private var tf:TextField;
private var format:TextFormat;
private var bmp:Bitmap;
private var bmd:BitmapData;
public function SuitAndValue(val:String, symbol:Sprite, color:uint)
{
var m:Matrix = new Matrix();
tf = new TextField();
format = new TextFormat('Times New Roman', 35, color, true);
format.letterSpacing = -4;
tf.text = val;
tf.setTextFormat(format);
if(val == '10' || val == 'A' || val == 'Q' || val == 'K')
{
if(val == '10')
{
m.tx = 4;
}
else
{
m.tx = 6;
}
m.scale(.7, 1);
}
else
{
m.tx = 4;
m.scale(1, 1);
}
bmd = new BitmapData(30, 70, true, 0x00FFFFFF);
var bmd2:BitmapData = new BitmapData(40, 38, true, 0x00FFFFFF);
bmd2.draw(tf);
bmd.draw(bmd2, m, null, null, null, true);
m.identity();
m.scale(.5, .5);
m.ty = 55;
m.tx = 15;
bmd.draw(symbol, m);
bmp = new Bitmap(bmd);
bmp.x = -bmp.width*.5;
bmp.y = -bmp.height*.5;
addChild(bmp);
}
}
class SuitClub extends Sprite
{
private static const _DATA:String =
"iVBORw0KGgoAAAANSUhEUgAAADQAAAA8CAYAAAApK5mGAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK"+
"T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU"+
"kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX"+
"Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB"+
"eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt"+
"AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3"+
"AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dX"+
"Lh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4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JDgepZMyVzptzdqGmtVnnhpyaZMvV926w0mKsxS1Z0bDgBVmqgwt3n97eRg7gutZjzy"+
"0V88VVvYS3Z5GeiBBaBmebOeU6WN9OWI12CygWc2gPq95j4dV5BktmD+bMkRVUnGoKIMuEf4BM81"+
"LZFUSGXledXOA9k5pM0kfDC2SfIsFQe+GcAk4ABwyUoD/wYASoYjvbigBhAAAAAASUVORK5CYII=";
public static var symbol:Sprite;
protected static var image:Loader;
public static function init():void
{
image = Base64ImageLoader.load(_DATA);
image.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
protected static function onComplete(event:Event):void
{
var mc:Bitmap = image.content as Bitmap;
mc.smoothing = true;
mc.height = 50;
mc.scaleX = mc.scaleY;
mc.x = mc.width*(-.5);
mc.y = mc.height*(-.5);
symbol = new Sprite();
symbol.addChild(mc);
}
}
class SuitDiamond extends Sprite
{
private static const _DATA:String =
"iVBORw0KGgoAAAANSUhEUgAAACkAAAA8CAYAAAD7e5PeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK"+
"T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU"+
"kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX"+
"Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB"+
"eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt"+
"AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3"+
"AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dX"+
"Lh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/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LdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADq"+
"YAAAOpgAABdvkl/FRgAAAqFJREFUeNrM2j1oFEEYxvF/7kwCnkYNghI/qoiCKFiohSgKWtjYKKSJ"+
"acTCQkkUVCQGUSsFY6E2iiiWaSwUbIygYBC/CKhgJWoSrKLR+EFMfGxmJKx3ub3dmd05eKo79n7s"+
"cu+9884gwGEaBScFTS6vi2Nku0CCg6EiFwreGeSIoCVEZK8B2lwODblVMBlBTgm2hYJsEDyJAG0G"+
"BPUhIE9UANoczhu5TjBeBTkqWJkXsk5wrwrQpi8vZFdMoE1H1sjVgrEakUOCpVkh6wR3awTaXMsK"+
"eSQh0KbNN3KN4GtK5HvBYl/IWYL+lECbG76QPY6ANntdIzcKvjtGDgmWu0I2CV44BtrcdoW86Alo"+
"cygtcpdnoARfTA+QCLlM8DEDpARPBXOSIPsyAtpcqBXZmTHQZk9c5HoP5SZuPglaqyHnCQZzAto8"+
"MEuSisirOQNtzlVCdgQCtNkdRa419Sok5Kjpuv7Nbx4GBrR5LCghuBQo0OZmASgS9qtoH3d/oHfx"+
"kX3cCFYIhgMDfrCFfXoJ2llm6JRXfgo2VyrmpwNBds30j1MU3MkZeD1Og9Filp15AF8K5kZNhTI/"+
"+RHgADCVcakZA/YB3/57Z4am91TGd3F/ks68PsP6eSvNQqzV7CT4BL4SNKdd0rZ7BE4KdriaYPhq"+
"hs+6HLMsELx2DBwwfYPTgdV2wW9HwHGz4PMynzzjCHnU5xB1tuCZg267wfc4epPgV0LgD8GGrHYf"+
"uhMiu7PcIikJntcIHCzXPPjebNoimIgJ/BOnaPvaWzwfE3klzw3QZsHbGLPxJWm+p5CyBxwFjlf5"+
"TA8wnOpbHJ0cqDRwvR/S8YZVgs8R4ISpqUEdFDkWQfaGeJqlJHgz7cjNolAPL7UZZGfIJ6wazYBh"+
"vsvr/h0AXndctReSU9MAAAAASUVORK5CYII=";
public static var symbol:Sprite;
protected static var image:Loader;
public static function init():void
{
image = Base64ImageLoader.load(_DATA);
image.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
protected static function onComplete(event:Event):void
{
var mc:Bitmap = image.content as Bitmap;
mc.smoothing = true;
mc.height = 50;
mc.scaleX = mc.scaleY;
mc.x = mc.width*(-.5);
mc.y = mc.height*(-.5);
symbol = new Sprite();
symbol.addChild(mc);
}
}
class SuitHeart extends Sprite
{
private static const _DATA:String =
"iVBORw0KGgoAAAANSUhEUgAAADgAAAA8CAYAAAAzF3kIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK"+
"T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU"+
"kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX"+
"Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB"+
"eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt"+
"AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3"+
"AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dX"+
"Lh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+"+
"5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk"+
"5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd"+
"0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+w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/pRncUZZu"+
"EkqzBEexCtc3WFlztb4Se5qBl81viJ0rS/T/AQAreaqWU5SFCwAAAABJRU5ErkJggg==";
public static var symbol:Sprite;
protected static var image:Loader;
public static function init():void
{
image = Base64ImageLoader.load(_DATA);
image.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
protected static function onComplete(event:Event):void
{
var mc:Bitmap = image.content as Bitmap;
mc.smoothing = true;
mc.height = 50;
mc.scaleX = mc.scaleY;
mc.x = mc.width*(-.5);
mc.y = mc.height*(-.5);
symbol = new Sprite();
symbol.addChild(mc);
}
}
class SuitSpade extends Sprite
{
private static const _DATA:String =
"iVBORw0KGgoAAAANSUhEUgAAADIAAAA8CAYAAAAkNenBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK"+
"T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU"+
"kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX"+
"Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB"+
"eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt"+
"AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3"+
"AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dX"+
"Lh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+"+
"5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk"+
"5NhKxEJbYc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AhVgo2NpIGg1aaIgo4gM0rKIQo01IiK7ia43JWORcWJbdeezOzM7ZA3+xAzsz"+
"39x7zz3zn4Hwox44BiRQHkcBG9ijGWI58FNAUkCDRoga4KFAGF3UCHIyB8IG/gJrNEGsBzJ5QGzg"+
"OVCnAWK6rAfbQec0gNx0gbCBcaA9zhBHPEAYDQCz4wixzmFdFNJdoDpOEHOAfp8QRhfiAjEFeFAk"+
"hNHBOIDcKBHClim5tZwQJwKAMBoBWssB0RkghFE/sDhKiL3AaAggNvAWmBcFxA7gT0gQRq+BxjAh"+
"NgPfQoYwegnMDQNiE5COCCJ7ZBYECbEN+BoxRHYpE0g2a49gTbjpC7ChFIgtwI8yQxgNAW3FQKwE"+
"hmMCYfQZWBhVERi2HgNJLxAJoDumEEZXvYCciTmE0W63DW9MCchHYGY+iCTwSgmEo4lxWBmE2V+a"+
"ci2cAYUgNnBa+2gYvTeG3yTgiWIQW14taFWUqQrpkiUv/ZbyHkyLBaxAfzRawPwKAJlmATMqAKTa"+
"kqylPX5ZYoxpjyEL+FABICkL6KkAkC7E1SuXQxKEUkCdJcXiLcWjcVkMEgBmAZ8UjkZXPrLt+G+d"+
"lVNvnPzhXQF7u2Muv4tVLx4aqcuAFyVe6J90su7kHH8EXCvBucwA54FarwtoMtAB9Pm80DBwHWiW"+
"iiHXA+gDqqS+OyXTY9zDeQeBK8CiQjfsVp7UAmvF/22WpDCViQ9mRmUaDkpzplueuKkU2oCnOefL"+
"AEuBd1ke2hJgNdAirkhSpmBaTMJe4JlsEYFFjYA0ZAEViuMFnu4BTbm9ysFauq0JxOn1eSTstlqQ"+
"cdZl8e7TAFEvdqYTSLcGkP0eU/XGOEMkfGym9+MMcsjnBtoZR4gmJvp8fkC+A6ti5WIA9yi+z1Hy"+
"9ydBOSgdUgymff7PlizXA+wEfhd7A/8HAEdVvabE81I4AAAAAElFTkSuQmCC";
public static var symbol:Sprite;
protected static var image:Loader;
public static function init():void
{
image = Base64ImageLoader.load(_DATA);
image.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
protected static function onComplete(event:Event):void
{
var mc:Bitmap = image.content as Bitmap;
mc.smoothing = true;
mc.height = 50;
mc.scaleX = mc.scaleY;
mc.x = mc.width*(-.5);
mc.y = mc.height*(-.5);
symbol = new Sprite();
symbol.addChild(mc);
}
}
// Copied from http://wonderfl.net/c/7ZwK
/**
* Base64化された画像データを表示可能な形式に変換するクラス
*
* 使い方 :
* var data:String = "Base64化された画像データ";
* var display:DisplayObjectContainer = Base64ImageLoader.load(data);
* if (display != null)
* addChild(display);
*/
class Base64ImageLoader
{
static public function load(data:String):Loader
{
var byteArray:ByteArray;
var base64Decoder:Base64Decoder;
var loader:Loader;
base64Decoder = new Base64Decoder();
base64Decoder.decode(data);
try {
byteArray = base64Decoder.toByteArray();
byteArray.position = 0;
} catch (e:Error) {
return null;
}
loader = new Loader();
loader.loadBytes(byteArray);
return loader;
}
}