Packagecom.whirled.contrib.card.graphics
Classpublic class NormalBiddingSprite
InheritanceNormalBiddingSprite Inheritance flash.display.Sprite

Represents the interface for normal bidding (nil to 13). It uses an embedded movie with predefined button objects within it. Buttons are simply hidden when they are not clickable.



Protected Properties
 PropertyDefined by
  _bids : Bids
NormalBiddingSprite
  _buttonNamePrefix : String
NormalBiddingSprite
  _maxBid : int
NormalBiddingSprite
  _movie : DisplayObjectContainer
NormalBiddingSprite
Public Methods
 MethodDefined by
  
NormalBiddingSprite(bids:Bids, movie:Class, buttonZeroName:String, labelColor:uint, labelBottom:int, fudgeOffset:int)
Create a new interface.
NormalBiddingSprite
Protected Methods
 MethodDefined by
  
bidListener(event:BidEvent):void
NormalBiddingSprite
  
buttonName(number:int):String
Retrieve the name of a button for a given bid value.
NormalBiddingSprite
  
buttonNumber(name:String):int
Retrieve the number of a button of a given name.
NormalBiddingSprite
  
clickListener(event:MouseEvent):void
Dispatch a click on a bid to the game model.
NormalBiddingSprite
  
getButton(num:int):SimpleButton
Get the button for a given bid amount.
NormalBiddingSprite
  
setMaxBid(max:int):void
NormalBiddingSprite
  
setupButtons():void
Add all the button listeners and take into account the maximum bid.
NormalBiddingSprite
Protected Constants
 ConstantDefined by
  NUM_BUTTONS : int = 14
[static]
NormalBiddingSprite
Property detail
_bidsproperty
protected var _bids:Bids
_buttonNamePrefixproperty 
protected var _buttonNamePrefix:String
_maxBidproperty 
protected var _maxBid:int
_movieproperty 
protected var _movie:DisplayObjectContainer
Constructor detail
NormalBiddingSprite()constructor
public function NormalBiddingSprite(bids:Bids, movie:Class, buttonZeroName:String, labelColor:uint, labelBottom:int, fudgeOffset:int)

Create a new interface.

Parameters
bids:Bids — allows the sprite to update automatically when it is time to bid (or not)
 
movie:Class — the embedded movie object containing all the buttons for bidding
 
buttonZeroName:String — the name of the zeroth button; other button names are computed from this name by replacing the "0" with the desired number
 
labelColor:uint — the outline color of the "Select your bid" text
 
labelBottom:int — the vertical offset of the bottom of the label text above the movie
 
fudgeOffset:int — the slight horizontal offset necessary to center the movie (we think this may be necessary due to shadows, but it looks better with it
Method detail
bidListener()method
protected function bidListener(event:BidEvent):voidParameters
event:BidEvent
buttonName()method 
protected function buttonName(number:int):String

Retrieve the name of a button for a given bid value.

Parameters
number:int

Returns
String
buttonNumber()method 
protected function buttonNumber(name:String):int

Retrieve the number of a button of a given name.

Parameters
name:String

Returns
int
clickListener()method 
protected function clickListener(event:MouseEvent):void

Dispatch a click on a bid to the game model.

Parameters
event:MouseEvent
getButton()method 
protected function getButton(num:int):SimpleButton

Get the button for a given bid amount.

Parameters
num:int

Returns
SimpleButton
setMaxBid()method 
protected function setMaxBid(max:int):voidParameters
max:int
setupButtons()method 
protected function setupButtons():void

Add all the button listeners and take into account the maximum bid.

Constant detail
NUM_BUTTONSconstant
protected static const NUM_BUTTONS:int = 14