ActionScript 3.0 Design Patterns
220 | Chapter 6: Composite Pattern 10 private var sName:String; 11 private var song:Sound; 12 private static var soundChannel:So ...
Example: Music Playlists | 221 The filename of the song clip is passed to the parameterized constructor and set to the sNameprop ...
222 | Chapter 6: Composite Pattern playlist called “eclectic” that includes both previous playlists and an additional song. The ...
Example: Animating Composite Objects Using Inverse Kinematics | 223 Using Inverse Kinematics Inverse kinematics is a method by w ...
224 | Chapter 6: Composite Pattern The Composite class shown in Example 6-12 extends theComponentclass and over- rides theupdate ...
Example: Animating Composite Objects Using Inverse Kinematics | 225 Both theComponentandCompositeclasses should behave as abstra ...
226 | Chapter 6: Composite Pattern The snake’s head will be controlled by keyboard events. The next step is to develop the docum ...
Example: Animating Composite Objects Using Inverse Kinematics | 227 Line 26 in theMainclass (Example 6-14) registers theonKeyPre ...
228 | Chapter 6: Composite Pattern Moving a Kinematic Pair As discussed before, our snake will be a composite object consisting ...
Example: Animating Composite Objects Using Inverse Kinematics | 229 The following steps relate to Figure 6-7. Initial condition ...
230 | Chapter 6: Composite Pattern Theupdate( )method implements steps three and four described in Figure 6-7. Lines 18-20 acces ...
Example: Animating Composite Objects Using Inverse Kinematics | 231 You may be wondering why theupdate( )method was not implemen ...
232 | Chapter 6: Composite Pattern declaring it asabstractin theComponentclass makes sense. We can now draw the whole snake. Bui ...
Using Flash’s Built-in Composite Structure: the Display List | 233 Note how the snake is constructed using the composite pattern ...
234 | Chapter 6: Composite Pattern the DisplayObject class. The more commonly used Sprite class extends DisplayObjectContainer, ...
Using Flash’s Built-in Composite Structure: the Display List | 235 Example 6-18 shows theIPlaneinterface. It defines two operati ...
236 | Chapter 6: Composite Pattern Example 6-20 shows the composite class for the airplane. It extends theSpriteclass and implem ...
Using Flash’s Built-in Composite Structure: the Display List | 237 Unlike theShapeclass,Spritedoes inherit fromInteractiveObject ...
238 | Chapter 6: Composite Pattern Even though our airplane is a simple line drawing (to reduce complexity), it’s possi- ble to ...
Using Flash’s Built-in Composite Structure: the Display List | 239 ences the root node of the airplane. The whole composite plan ...
«
8
9
10
11
12
13
14
15
16
17
»
Free download pdf