Packagecom.whirled.contrib.card.graphics
Classpublic class CardSprite
InheritanceCardSprite Inheritance flash.display.Sprite

Represents a card graphic with a few appearance flags. It relies on an embedded movie object where each frame in the movie is a card. The names of the frames must match the short names provided by the Card class.



Public Properties
 PropertyDefined by
  card : Card
[read-only] Access the underlying card object.
CardSprite
  nextSpriteId : int = 0
[static] For debugging, give each card sprite a unique id.
CardSprite
  state : CardState
Access to the card's highlight state.
CardSprite
Protected Properties
 PropertyDefined by
  _card : Card
CardSprite
  _cover : Sprite
CardSprite
  _deck : MovieClip
CardSprite
  _height : int
CardSprite
  _id : int
CardSprite
  _state : CardState
CardSprite
  _width : int
CardSprite
Public Methods
 MethodDefined by
  
CardSprite(card:Card, deck:Class, width:int, height:int)
Create a new card sprite.
CardSprite
  
toString():String
CardSprite
Protected Methods
 MethodDefined by
  
gotDeck(clip:MovieClip):void
CardSprite
  
update():void
CardSprite
Public Constants
 ConstantDefined by
  DISABLED : CardState
[static] Disabled appearance
CardSprite
  EMPHASIZED : CardState
[static] Emphasized appearance
CardSprite
  HIGHLIGHTED : CardState
[static] Highlighted appearance
CardSprite
  NORMAL : CardState
[static] Normal appearance
CardSprite
Protected Constants
 ConstantDefined by
  BACK_FRAME : String = "CB"
[static]
CardSprite
Property detail
_cardproperty
protected var _card:Card
cardproperty 
card:Card  [read-only]

Access the underlying card object.

Implementation
    public function get card():Card
_coverproperty 
protected var _cover:Sprite
_deckproperty 
protected var _deck:MovieClip
_heightproperty 
protected var _height:int
_idproperty 
protected var _id:int
nextSpriteIdproperty 
public static var nextSpriteId:int = 0

For debugging, give each card sprite a unique id.

_stateproperty 
protected var _state:CardState
stateproperty 
state:CardState  [read-write]

Access to the card's highlight state.

Implementation
    public function get state():CardState
    public function set state(value:CardState):void
_widthproperty 
protected var _width:int
Constructor detail
CardSprite()constructor
public function CardSprite(card:Card, deck:Class, width:int, height:int)

Create a new card sprite.

Parameters
card:Card
 
deck:Class
 
width:int
 
height:int
Method detail
gotDeck()method
protected function gotDeck(clip:MovieClip):voidParameters
clip:MovieClip
toString()method 
public override function toString():String

Returns
String
update()method 
protected function update():void
Constant detail
BACK_FRAMEconstant
protected static const BACK_FRAME:String = "CB"
DISABLEDconstant 
public static const DISABLED:CardState

Disabled appearance

EMPHASIZEDconstant 
public static const EMPHASIZED:CardState

Emphasized appearance

HIGHLIGHTEDconstant 
public static const HIGHLIGHTED:CardState

Highlighted appearance

NORMALconstant 
public static const NORMAL:CardState

Normal appearance