Graphics Reference
In-Depth Information
Figure 13.1 The iPhone
application “Memory4Kidz”
was built in Flash Professional
CS5 using a slightly modified
version of the memory game.
my intention for this class was (and is) to add new functionality to it
as needed. If I do happen to add anything to it, I
'
ll be sure to keep
it updated on the site.
DeckArray Code
package com.flashadbook.utils{
dynamic public class DeckArray extends Array{
private var _deckCount:uint; // the number of
cards in the deck
private var _shuffleNumber:int; // how many
times the deck has been shuffled in a single call
private var _shuffleCard:Object; // the card
currently being shuffled
public function DeckArray( args){
for each (var val:* in args){
super.push(val);
}
}
public function
shuffle(timesToShuffle:int=2):Array{
_deckCount = this.length;
_shuffleNumber = 0;
while(_shuffleNumber
<
timesToShuffle){
for(var c:int=0; c
_deckCount; c++){
// remove a random card from the
<
deck and place it back on top
Search WWH ::




Custom Search