ActionScript 3.0 Design Patterns

(Chris Devlin) #1
Index | 507

Q


QuadPets.as, 25


R


Radio.as, 273
Rage.as, 157
RBView.as, 455
RearViewVideo.as, 169
receiver class, 272
Receiver.as, 252
Receiver1.as and Receiver2.as, 257
Record state, 383
RecordAudio.as, 55
RecordMedia.as, 55
RecordState class, 387
RecordState.as, 388
RecordVideo.as, 55
Referee.as, 479
remove( ) method, 214, 255
request, 44
return statement, 4
RHController.as, 460
Rock, Paper, Scissors, 470
Rock.as, 35
rocket.fla, 7
RootNodeView.as, 440
RPS.as, 481


S


Schreiner, Axel, 470
scope, 4
sequential programming, 4
Server Side Communication ActionScript (see
SSCA)
SetToMusicGenreCommand.as, 278
ShapeCreator.as, 88
ShapeWidget class, 85
ShapeWidget.as, 86
ShedMaker.as, 342
Ship.as, 94
ShipCreator.as, 99
ShopCart.as, 122
ShowText.as, 420
simpleFactory( ) method, 66
SimpleSort.as, 419
single responsibility principle, 443
Singleton pattern, 63, 101–105
classic singleton, 103
key features, 101
minimal abstract singleton, 105–112
instantiation method, 108


one instance, different
references, 109–112
private class parameter, instantiation
with, 106–108
model, 102
one instance, multiple references, 112
OOP concepts used in, 102–105
private class constructors, creating and
using, 103
private classe instances, creating, 104
private class constructors, 103
private statci instantiation of an
instance, 103
public static functions for creating class
instances, 103
summary, 125
usage, 112–125
alert message, 113–116
music playback, 116–121
shopping cart, multiple
references, 121–125
Singleton.as, 106, 110
SingletonTest.as, 111
Skits.as, 409
Song.as, 219
SortAll.as, 420
SortBack.as, 420
SortWork.as, 418
Soul.as, 162
space battle game, 302–317
battles, recording, 303
concrete classes, 303–306
launching a battle, 306–317
building android space station and
beam, 309
building spaceships, 306
building weapons, 307
change handler, writing, 311–317
Flash document setup, 306
spaghetti programs, 4
Sprite class, 84
DisplayObject and
DisplayObjectContainer
classes, 233
Sprite factory, 84–90
cleints, 89
shape creators, 87
shape widgets, 85
Sprite objects, 6
SquareWidget.as, 86
SSCA (Server Side Communication
ActionScript), 483, 485
Free download pdf