Contents at a Glance
Figures............................................................................................................................. vii
Listings............................................................................................................................ xiii
Foreword........................................................................................................................ xvii
Acknowledgements......................................................................................................... xix
Introduction....................................................................................................................... 1
Handling a Click Event......................................................................................................... 5
Setting a Property............................................................................................................. 21
Handling a Click Event – Part II........................................................................................... 33
Creating an Interactive “Rollover” Screen......................................................................... 43
Hyperlinking to a URL........................................................................................................ 73
Sending Email................................................................................................................... 99
Organizing Navigation..................................................................................................... 131
Dynamically Loading Graphics and Media........................................................................ 149
Reading XML................................................................................................................... 181
Making SCORM Calls....................................................................................................... 201
Creating Drag & Drop Interactions................................................................................... 229
Building a Glossary.......................................................................................................... 243
Creating a Simple Calculator............................................................................................ 263
Debugging Your
Applications........................................................................................... 291
Introduction to Object-Oriented Programming................................................................ 307
Detailed Object-Oriented Programming Example............................................................ 317
Conclusions..................................................................................................................... 341
Index.............................................................................................................................. 345
Table of Contents
Figures............................................................................................................................. vii
Listings............................................................................................................................ xiii
Foreword........................................................................................................................ xvii
Acknowledgements......................................................................................................... xix
Introduction....................................................................................................................... 1
Audience Level................................................................................................................ 2
Sample Applications........................................................................................................ 2
A Bit of Background......................................................................................................... 2
Why These Four Environments?....................................................................................... 3
Handling a Click Event......................................................................................................... 5
Introduction.................................................................................................................... 5
ToolBook – OpenScript.................................................................................................... 5
ToolBook – Actions
Editor................................................................................................ 6
Flash............................................................................................................................... 7
JavaScript...................................................................................................................... 11
Silverlight...................................................................................................................... 15
Setting a Property............................................................................................................. 21
ToolBook – OpenScript................................................................................................... 21
ToolBook – Actions
Editor.............................................................................................. 22
Flash.............................................................................................................................. 25
JavaScript...................................................................................................................... 27
Silverlight...................................................................................................................... 29
Handling a Click Event – Part II........................................................................................... 33
ToolBook – OpenScript................................................................................................... 34
ToolBook – Actions
Editor.............................................................................................. 35
Flash.............................................................................................................................. 36
JavaScript...................................................................................................................... 37
Silverlight...................................................................................................................... 40
Creating an Interactive “Rollover” Screen......................................................................... 43
ToolBook – OpenScript................................................................................................... 43
ToolBook – Actions
Editor.............................................................................................. 48
Flash.............................................................................................................................. 53
JavaScript...................................................................................................................... 59
Silverlight...................................................................................................................... 64
Hyperlinking to a URL........................................................................................................ 73
ToolBook – OpenScript................................................................................................... 74
ToolBook – Actions
Editor.............................................................................................. 78
Flash.............................................................................................................................. 82
JavaScript...................................................................................................................... 89
Silverlight...................................................................................................................... 92
Sending Email................................................................................................................... 99
ASP.NET Web Service..................................................................................................... 99
HTTP Post Explained..................................................................................................... 109
ToolBook – OpenScript................................................................................................. 111
ToolBook – Actions
Editor............................................................................................. 113
Flash............................................................................................................................ 115
JavaScript..................................................................................................................... 120
Silverlight.................................................................................................................... 126
Organizing Navigation..................................................................................................... 131
ToolBook – OpenScript................................................................................................. 131
ToolBook – Actions
Editor............................................................................................. 134
Flash............................................................................................................................ 134
JavaScript..................................................................................................................... 138
Silverlight.................................................................................................................... 143
Dynamically Loading Graphics and Media........................................................................ 149
ToolBook – OpenScript................................................................................................. 149
ToolBook – Actions
Editor............................................................................................. 155
Flash............................................................................................................................ 159
JavaScript..................................................................................................................... 166
Silverlight.................................................................................................................... 173
Reading XML................................................................................................................... 181
ToolBook – OpenScript................................................................................................. 182
ToolBook – Actions
Editor............................................................................................. 186
Flash............................................................................................................................ 191
JavaScript..................................................................................................................... 194
Silverlight.................................................................................................................... 197
Making SCORM Calls....................................................................................................... 201
SCORM Runtime Environment Overview...................................................................... 201
ToolBook – Actions
Editor............................................................................................. 202
Flash............................................................................................................................ 208
JavaScript..................................................................................................................... 218
Silverlight.................................................................................................................... 222
Creating Drag & Drop Interactions................................................................................... 229
ToolBook – OpenScript................................................................................................. 229
Flash............................................................................................................................ 232
JavaScript..................................................................................................................... 235
Silverlight.................................................................................................................... 238
Building a Glossary.......................................................................................................... 243
ASP.NET Web Service................................................................................................... 243
ToolBook – OpenScript................................................................................................. 246
ToolBook – Actions
Editor............................................................................................. 248
Flash............................................................................................................................ 250
JavaScript..................................................................................................................... 254
Silverlight.................................................................................................................... 259
Creating a Simple Calculator............................................................................................ 263
ToolBook – OpenScript................................................................................................. 263
ToolBook – Actions
Editor............................................................................................. 267
Flash............................................................................................................................ 272
JavaScript..................................................................................................................... 278
Silverlight.................................................................................................................... 283
Debugging Your
Applications........................................................................................... 291
ToolBook – OpenScript................................................................................................. 291
ToolBook – Actions
Editor............................................................................................. 294
Flash............................................................................................................................ 295
JavaScript..................................................................................................................... 297
Silverlight.................................................................................................................... 305
Introduction to Object-Oriented Programming................................................................ 307
Overview..................................................................................................................... 307
Classes and Instances................................................................................................... 308
Methods...................................................................................................................... 309
Events.......................................................................................................................... 310
Properties.................................................................................................................... 310
Inheritance.................................................................................................................. 311
Encapsulation.............................................................................................................. 312
Polymorphism............................................................................................................. 313
Overriding................................................................................................................... 313
Overloading................................................................................................................. 313
Constructors................................................................................................................ 315
Variables, Access Modifiers, and
Scope........................................................................ 315
Detailed Object-Oriented Programming Example............................................................ 317
ToolBook – OpenScript................................................................................................. 318
Flash............................................................................................................................ 325
Silverlight.................................................................................................................... 332
Conclusions..................................................................................................................... 341
ToolBook – OpenScript................................................................................................. 341
ToolBook – Actions
Editor............................................................................................. 342
Flash............................................................................................................................ 342
JavaScript..................................................................................................................... 342
Silverlight.................................................................................................................... 343
Index.............................................................................................................................. 345
Figure 1. “buttonClick” Message Box from ToolBook OpenScript...................................................................... 6
Figure 2. List of Available
Events in
the ToolBook Actions Editor..................................................................... 6
Figure 3. “On Click” Message Box from ToolBook Actions Editor...................................................................... 7
Figure 4. Handling the "On click" in the ToolBook Actions Editor..................................................................... 7
Figure 5. Message Displayed in the Flash ActionScript 2 Alert Component.................................................... 8
Figure 6. Flash Timeline Showing an
Actions Layer.............................................................................................. 8
Figure 7. MouseEvent Popup List in Flash............................................................................................................ 10
Figure 8. Result from Event Listener in Flash....................................................................................................... 10
Figure 9. Visual Studio Showing Both
HTML and Design Views........................................................................ 11
Figure 10. Client Objects & Events Dropdown List in Visual
Studio................................................................ 13
Figure 11. Client Event DropDown in Visual
Studio............................................................................................ 13
Figure 12. IntelliSense for JavaScript in Visual
Studio...................................................................................... 14
Figure 13. JavaScript Alert Box............................................................................................................................... 14
Figure 14. Silverlight XAML and Design View in Expression Blend.................................................................. 15
Figure 15. Selecting the Click Event for a
Silverlight Button in
Visual Studio............................................... 16
Figure 16. Creating the Click Event Handler via
IntelliSense in Visual
Studio.............................................. 16
Figure 17. MessageBox IntelliSense Demonstrating an Overloaded Met