ActionScript 3.0 Design Patterns
300 | Chapter 8: Observer Pattern Feel free to change the text in the various “headlines” forThe Daily Bugle. Playing the Bugle ...
Example: Adding States and Identifying Users | 301 Be sure to save theBugleSubscribe.asin the same folder as the other files in ...
302 | Chapter 8: Observer Pattern Whoaa!, the stock market is at 2987.98 and The Bad Bug is showing at the Bijou. Curly sees tha ...
Dynamically Changing States | 303 update functions. The subscribe and unsubscribe functions are the same as previous Observer de ...
304 | Chapter 8: Observer Pattern Example 8-17. ConcreteSubject.as package { //Concrete Subject public class ConcreteSubject imp ...
Dynamically Changing States | 305 Now that all of the basic programs are built, the real work begins. In the following section, ...
306 | Chapter 8: Observer Pattern Launching the Space Battle In Example 8-19, you’ll find a class that handles a battle in space ...
Dynamically Changing States | 307 Repeat Steps 1 through 5 to create a movie clip namedAlien. Make a different ship and point i ...
308 | Chapter 8: Observer Pattern In the Symbol editing mode, drag a copy of thebulletmovie clip to the center position (X=0, Y ...
Dynamically Changing States | 309 Click on the Export for ActionScript checkbox in the Linkage group. You should see the Export ...
310 | Chapter 8: Observer Pattern You have set up all the classes and objects you’ll need for the stage. Check your Library pane ...
Dynamically Changing States | 311 is sent to all subscribers via the Observer design pattern. Each of the windows show- ing the ...
312 | Chapter 8: Observer Pattern private var eFlag:Number; private var lFlag:Number; private var outputColor:Number; private va ...
Dynamically Changing States | 313 battleUpdate[i].wordWrap=true; battleUpdate[i].multiline=true; battleUpdate[i].border=true; ba ...
314 | Chapter 8: Observer Pattern androidMC=new Android( ); addChild (androidMC); androidMC.x=300; androidMC.y=380; beam=new Bea ...
Dynamically Changing States | 315 private function fireBeam (evt:Event) { beam.play ( ); aFlag=0; aeFlag=0; } //Android beam hit ...
316 | Chapter 8: Observer Pattern When you test the script, you’ll find that when you fire on the Android, only the Earthling’s ...
Example: Working with Different Data Displays | 317 Example: Working with Different Data Displays The last example showed how qu ...
318 | Chapter 8: Observer Pattern To make the task more manageable and reusable, all the display outputs are orga- nized into se ...
Example: Working with Different Data Displays | 319 The Concrete Classes and a Double Implementation Both the concrete subject a ...
«
12
13
14
15
16
17
18
19
20
21
»
Free download pdf