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 Method............................................... 17
Figure 18. MessageBox Displayed from
Silverlight............................................................................................ 17
Figure 19. Popup Control in Blend......................................................................................................................... 18
Figure 20. Silverlight Showing a Popup Control in Response to a Button
Click............................................ 19
Figure 21. ToolBook Properties Sheet.................................................................................................................... 21
Figure 22. Selecting the rgbFill Property in the ToolBook Actions Editor........................................................ 23
Figure 23. Build Expression Button in the
ToolBook Actions Editor................................................................ 23
Figure 24. Build Expression Dialog Showing
Special Values in the ToolBok Actions Editor...................... 24
Figure 25. Setting the rgbFill Property in Response to the click and load page Events with the
ToolBook Actions Editor. 25
Figure 26. Popup List of TextFormat Properties in ActionScript Editor.......................................................... 26
Figure 27. The Style Property for an HTML Button in
Visual Studio................................................................. 27
Figure 28. Modify Style Dialog
Box in Visual Studio.......................................................................................... 28
Figure 29. Changing the Foreground Color in Blend........................................................................................... 30
Figure 30. Incorrect "Foreground" Code and the Error List in Visual
Studio................................................. 30
Figure 31. Overloaded SolidColorBrush
Constructor in Visual
Studio.......................................................... 31
Figure 32. Advanced Click Event Example -
ToolBook OpenScript................................................................... 33
Figure 33. Native ToolBook Message
Hierarchy.................................................................................................. 34
Figure 34. Group-Level Action Using Target in the ToolBook Actions Editor................................................. 35
Figure 35. Target Concept in
Flash......................................................................................................................... 36
Figure 36. Target Concept in HTML and JavaScript............................................................................................. 38
Figure 37. Target Concept in
Silverlight................................................................................................................ 40
Figure 38. Interactive Example - ToolBook OpenScript...................................................................................... 44
Figure 39. Interactive Example - ToolBook Actions Editor................................................................................ 49
Figure 40. Interactive Example Implementation (On load page): ToolBook Actions Editor........................ 50
Figure 41. Interactive Example Implementation (On mouse over part 1):
ToolBook Actions Editor......... 51
Figure 42. Interactive Example Implementation (On mouse over part 2):
ToolBook Actions Editor......... 52
Figure 43. Interactive Example - Flash.................................................................................................................. 54
Figure 44. Interactive Example in Flash Showing Objects
Moved Off the Stage........................................... 55
Figure 45. Converting an Instance of a Symbol
from a Graphic to a Movie Clip In Order to
Refer to It By Name. 55
Figure 46. Interactive Example - HTML and JavaScript...................................................................................... 60
Figure 47. Interactive Example - Silverlight......................................................................................................... 65
Figure 48. Silverlight Grid in Microsoft
Expression Blend................................................................................ 66
Figure 49. IntelliSense for
MouseEventArgs in Silverlight................................................................................ 70
Figure 50. Setting Graphics to Resources in Visual
Studio............................................................................... 71
Figure 51. Hyperlinking Example -
ToolBook OpenScript.................................................................................. 73
Figure 52. Create Hotword Menu Item in
ToolBook............................................................................................ 77
Figure 53. Hyperlinking Example -
ToolBook Actions Editor............................................................................. 78
Figure 54. Linking to a JavaScript File in
ToolBook............................................................................................ 79
Figure 55. Configuring an Execute Script Action................................................................................................. 80
Figure 56. Setting the url Parameter for the
showWindow Function.............................................................. 81
Figure 57. Hotword Action and
Hard-Coded Parameter.................................................................................... 82
Figure 58. Hyperlinking Example - Flash.............................................................................................................. 83
Figure 59. Hyperlinking Example - HTML and JavaScript................................................................................... 89
Figure 60. Hyperlinking Example -
Silverlight...................................................................................................... 93
Figure 61. Adding a Web Service in Visual
Studio............................................................................................ 100
Figure 62. Setting the Web Service as the Start Page in Visual
Studio......................................................... 107
Figure 63. Web Service Test Pages....................................................................................................................... 108
Figure 64. Simple Web Page Showing Entry Fields........................................................................................... 109
Figure 65. Sending Email from ToolBook OpenScript...................................................................................... 111
Figure 66. Sending Email with ToolBook Using the
Actions Editor................................................................ 113
Figure 67. Sending Email Example Built with the ToolBook Actions Editor................................................. 114
Figure 68. The formatBody Action Method......................................................................................................... 115
Figure 69. Sending Email From Flash.................................................................................................................. 116
Figure 70. Email Result from Flash Showing
htmlText for the Body.............................................................. 119
Figure 71. Sending Email from HTML and JavaScript....................................................................................... 121
Figure 72. Sending Email from Silverlight.......................................................................................................... 126
Figure 73. Adding a Web Service Reference in Visual
Studio......................................................................... 127
Figure 74. Discovering and Connecting to a Web Service in Visual
Studio................................................. 128
Figure 75. Using IntelliSense to Connect to
the Service Reference................................................................ 129
Figure 76. Hyperlink Dialog Box in
ToolBook.................................................................................................... 131
Figure 77. Navigation Example -
ToolBook........................................................................................................ 132
Figure 78. Navigating to a Page in the ToolBook Actions Editor.................................................................... 134
Figure 79. Navigation Example - Flash............................................................................................................... 135
Figure 80. Navigation Example - HTML and JavaScript.................................................................................... 138
Figure 81. Navigation Example -
Silverlight....................................................................................................... 143
Figure 82. Dynamic Graphics and Media Example -
ToolBook OpenScript................................................. 149
Figure 83. Dynamic Media Example -
ToolBook Actions Editor..................................................................... 156
Figure 84. Directory Structure for ToolBook Content Published to
HTML.................................................... 157
Figure 85. Hiding the Players via the On load page Event in the ToolBook Actions Editor...................... 157
Figure 86. Click Logic for Dynamic Media Example -
ToolBook Actions Editor.......................................... 158
Figure 87. Dynamic Graphics and Media Example - Flash............................................................................. 159
Figure 88. Layout of Flash Movie for
Dynamic Graphics and Media Example........................................... 160
Figure 89. Dynamic Graphics and Media Example - HTML and JavaScript................................................. 167
Figure 90. Dynamic Graphics and Media Example -
Silverlight.................................................................... 173
Figure 91. Updating the Silverlight Web Service Reference in Visual
Studio.............................................. 176
Figure 92. Reading an XML File - ToolBook OpenScript................................................................................... 182
Figure 93. Reading an XML File - ToolBook Actions Editor............................................................................. 186
Figure 94. Open Document Catalog
Object for Moving imsmanifest.xml File to media Directory........... 187
Figure 95. Selecting the readManifestResources
function in the ToolBook Actions Editor........................ 190
Figure 96. Actions Editor Logic for
Reading XML.............................................................................................. 191
Figure 97. Reading an XML File - Flash............................................................................................................... 192
Figure 98. Reading an XML File - HTML and JavaScript................................................................................... 195
Figure 99. Reading an XML File -
Silverlight...................................................................................................... 198
Figure 100. Publishing ToolBook Content as SCORM 1.2................................................................................ 203
Figure 101. SCORM Tester
Application - ToolBook Actions Editor................................................................ 204
Figure 102. Selecting a SCORM Call in the
ToolBook Actions Editor............................................................ 205
Figure 103. Configuring the "Execute SCORM" Action...................................................................................... 205
Figure 104. Complete "LMSGetValue" Action..................................................................................................... 206
Figure 105. Shared Action for
Formatting "SetValue" Parameters................................................................ 206
Figure 106. Calling the FormatSelValue
Shared Action.................................................................................... 207
Figure 107. Configuring the LMSSetValue Call................................................................................................... 208
Figure 108. SCORM Tester
Application - Flash.................................................................................................. 209
Figure 109. SCORM Tester
Application - HTML and JavaScript...................................................................... 219
Figure 110. SCORM Tester
Application - Silverlight......................................................................................... 223
Figure 111. Drag & Drop Example -
ToolBook OpenScript.............................................................................. 229
Figure 112. Drag & Drop Example - Flash.......................................................................................................... 232
Figure 113. Drag & Drop Example - HTML and JavaScript............................................................................... 235
Figure 114. Drag & Drop Example -
Silverlight.................................................................................................. 239
Figure 115. Acess Database for Storing our
Glossary Information.............................................................. 243
Figure 116. Glossary Example -
ToolBook OpenScript.................................................................................... 246
Figure 117. Glossary Example -
ToolBook Actions Editor............................................................................... 248
Figure 118. DisplayGlossaryDefinition
Shared Action....................................................................................... 249
Figure 119. Calling the DisplayGlossaryDefinition
Shared Action and Setting Its Parameter................... 250
Figure 120. Glossary Example - Flash................................................................................................................. 251
Figure 121. Glossary Example - HTML and JavaScript..................................................................................... 255
Figure 122. Glossary Example -
Silverlight........................................................................................................ 259
Figure 123. Simple Calculator - ToolBook OpenScript.................................................................................... 263
Figure 124. Simple Calculator - ToolBook Actions Editor............................................................................... 267
Figure 125. Action Methods Dialog in ToolBook.............................................................................................. 268
Figure 126. Calling the UpdateTotal
Action Method........................................................................................ 269
Figure 127. UpdateTotal Action
Method Logic................................................................................................... 270
Figure 128. SetOperator Action
Method Logic................................................................................................... 271
Figure 129. Action for the "Clear" Calculator Button....................................................................................... 271
Figure 130. Action for the "Equals" Calculator Button.................................................................................... 272
Figure 131. Simple Calculator - Flash................................................................................................................. 273
Figure 132. Simple Calculator - HTML and JavaScript..................................................................................... 278
Figure 133. Simple Calculator - Silverlight........................................................................................................ 284
Figure 134. Converting a Width Value to a
Resources in Expression Blend............................................... 285
Figure 135. Launching the ToolBook OpenScript
Debugger from the Script Editor.................................... 291
Figure 136. Adding a Breakpoint in ToolBook OpenScript.............................................................................. 292
Figure 137. Trace Menu in the ToolBook OpenScript
Debugger..................................................................... 292
Figure 138. ToolBook OpenScript
Debugger and Viewing Variables............................................................ 293
Figure 139. Using Alerts for Debugging in the ToolBook Actions Editor...................................................... 294
Figure 140. Setting a Breakpoint in Flash.......................................................................................................... 295
Figure 141. Launching a Flash Movie in Debug Mode..................................................................................... 296
Figure 142. Viewing Variables in the Flash Debugger..................................................................................... 296
Figure 143. Controlling Your Flash Debugging with the Debug
Menu.......................................................... 297
Figure 144. Setting a JavaScript Breakpoint in Visual
Studio........................................................................ 297
Figure 145. Internet Explorer Dialog Box for Enabled JavaScript Debugging.............................................. 298
Figure 146. The Visual Studio Debug Menu....................................................................................................... 299
Figure 147. JavaScript Debugging in Visual
Studio Showing the
Locals Window...................................... 299
Figure 148. Starting the Firefox JavaScript Debugger...................................................................................... 300
Figure 149. Setting a Breakpoint in the Firefox
JavaScript Debugger........................................................... 300
Figure 150. The Debug Menu in the Firefox
Debugger...................................................................................... 301
Figure 151. JavaScript Debugging in Firefox
Showing Local Variables........................................................ 301
Figure 152. Launching the Internet Explorer Developer Tools....................................................................... 302
Figure 153. Selecting the Desired .js File in the Internet Explorer
Debugger............................................... 302
Figure 154. Setting a Breakpoint in the Internet
Explorer Debugger............................................................. 303
Figure 155. JavaScript Debugging in Internet
Explorer Showing Local Variables...................................... 304
Figure 156. Setting a Silverlight Breakpoint in Visual
Studio........................................................................ 305
Figure 157. Viewing Silverlight Local Variables
While Debugging in Visual Studio................................. 306
Figure 158. TPS76333 Pin Assignments.............................................................................................................. 307
Figure 159. Home Theater Audio Block Diagram.............................................................................................. 308
Figure 160. ProSportsTeams
Inheritance Example............................................................................................ 312
Figure 161. Detailed Object-Oriented Example With Animal, Cat, and Dog
Classes................................. 317
Figure 162. Detailed Object-Oriented Programming Example Application -
ToolBook OpenScript....... 318
Figure 163. Simulated Object-Oriented ToolBook Architecture..................................................................... 319
Figure 164. Detailed Object-Oriented Programming Example Application -
Flash................................... 325
Figure 165. Creating an External ActionScript File in Flash........................................................................... 329
Figure 166. Detailed Object-Oriented Programming Example Application -
Silverlight........................... 333
Figure 167. IntelliSense in Visual
Studio Showing Animal Properties and Methods................................ 336
Figure 168. Adding a Class in Visual
Studio...................................................................................................... 337
Listing 1. Handling the “buttonClick” Event in ToolBook OpenScript................................................................ 5
Listing 2. "on click" handler in Flash ActionScript 2............................................................................................ 7
Listing 3. Setting Up an Event Listener and Associated
Function for the Click Event...................................... 9
Listing 4. CSS Reference and Relevant
Section of CSS File................................................................................. 12
Listing 5. onclick Handler in
JavaScript................................................................................................................ 14
Listing 6. Click Handler using a Message Box in Silverlight............................................................................. 17
Listing 7. Silverlight Click Handler
Displaying a Popup.................................................................................... 19
Listing 8. OpenScript Code for Setting the Color Property and Resetting
it on EnterPage........................... 22
Listing 9. Setting Up an Event Listener and Changing
the Color of a Button Component............................. 26
Listing 10. HTML and JavaScript for Setting the
backgroundColor Property of a Button............................. 29
Listing 11. Setting the Foreground Property of a Button in
Silverlight............................................................ 31
Listing 12. Page Script Showing the Use of Target and the Message
Hierarchy in ToolBook OpenScript. 34
Listing 13. ActionScript Showing the
Assigning of the Same Function to Multiple
Buttons....................... 37
Listing 14. HTML Using a Table and Showing the
Assignment of the Same Function to all Buttons......... 38
Listing 15. JavaScript Showing Object
Reference and document.getElementById Function....................... 39
Listing 16. Silverlight XAML Showing Grid and Assigning
All Buttons to the Same Handler...................... 41
Listing 17. Visual Basic in Silverlight Showing CType() and String.Format()................................................. 42
Listing 18. Interactive Example Implementation (mouseEnter) - ToolBook OpenScript.............................. 45
Listing 19. Interactive Example Implementation (enterPage and mouseLeave)
- ToolBook OpenScript.. 48
Listing 20. ActionScript Global
Variables and Initialization Code................................................................. 56
Listing 21. implementRollover Implementation in Flash ActionScript........................................................... 58
Listing 22. HTML for Interactive
Example............................................................................................................. 61
Listing 23. CSS Classes for Interactive
Example.................................................................................................. 62
Listing 24. Global Variables and implementRollover Implementation in
JavaScript.................................. 63
Listing 25. Interaction.xaml for Interactive Example......................................................................................... 68
Listing 26. implementRollover Code in Visual Basic (Silverlight)................................................................... 70
Listing 27. ASYM_AddHyperlink Implementation................................................................................................ 74
Listing 28. ShellExecute Hyperlinking Implementation...................................................................................... 75
Listing 29. Automation Hyperlinking Implementation....................................................................................... 76
Listing 30. Handling Hotword Clicks in
ToolBook OpenScript......................................................................... 77
Listing 31. JavaScript Code Used in
ToolBook Actions Editor and Other
Examples..................................... 79
Listing 32. Dynamic Hyperlinking with
ActionScript Using
navigateToURL................................................... 84
Listing 33. Dynamic Hyperlinking with
ActionScript Using External
Interface............................................. 85
Listing 34. Creating and Handling Hyperlinks in Flash ActionScript.............................................................. 87
Listing 35. HTML for First
Hyperlinking Example................................................................................................ 90
Listing 36. JavaScript for
Hyperlinking Example................................................................................................. 90
Listing 37. HTML and CSS for Second
Hyperlinking Example............................................................................ 91
Listing 38. XAML and Visual
Basic Code for
"Show Window" and "Close
Window" Example................... 94
Listing 39. Key XAML from
Hyperlinking Text Example in
Silverlight.............................................................. 95
Listing 40. Visual Basic for
Hyperlinking Text Example in
Silverlight............................................................ 96
Listing 41. Storing User Settings in the web.config File................................................................................... 101
Listing 42. Email Web Service Property Code.................................................................................................... 102
Listing 43. Email Web Service Implementation
Code....................................................................................... 105
Listing 44. HTML for a Simple
"Post" Page......................................................................................................... 110
Listing 45. Server-Side Code for
Reading Post "Parameters."......................................................................... 110
Listing 46. Sending Email with ToolBook OpenScript
Using HTTP Post........................................................ 112
Listing 47. ActionScript Code to Send Email via Web
Service using HTTP Post.......................................... 117
Listing 48. HTML for "Send Email"
Example....................................................................................................... 122
Listing 49. JavaScript for "Send Email"
Example............................................................................................... 124
Listing 50. Visual Basic for “Send Email” Example........................................................................................... 130
Listing 51. Dynamically Creating Menu Hotwords and Hyperlinks in ToolBook OpenScript.................. 133
Listing 52. Navigation Logic and
Dynamic Menu Creation Code - Flash...................................................... 137
Listing 53. CSS and HTML for Navigation Example........................................................................................... 140
Listing 54. Logic and Dynamic Menu Creation Code -
JavaScript.................................................................. 142
Listing 55. XAML, Logic, and Dynamic Menu Creation Code -
Silverlight..................................................... 146
Listing 56. Configuration Logic for
Dynamic Graphics and Media Example -
ToolBook OpenScript..... 151
Listing 57. Click Logic for Dynamic Graphics and Media Example -
ToolBook OpenScript..................... 154
Listing 58. ActionScript for Dynamic
Graphics and Media Example............................................................ 164
Listing 59. HTML for Dynamic
Graphics and Media Example........................................................................ 169
Listing 60. JavaScript for Dynamic
Graphics and Media Example................................................................ 172
Listing 61. Web Service Methods for Retrieving
Graphic and Media File Names -
Visual Basic............ 175
Listing 62. Silverlight XAML for Dynamic Graphics and Media Example..................................................... 177
Listing 63. Visual Basic for Silverlight Dynamic
Graphics and Media Example........................................ 179
Listing 64. Section of imsmanifest.xml file........................................................................................................ 181
Listing 65. Reading XML with ToolBook OpenScript......................................................................................... 184
Listing 66. Reading XML in JavaScript................................................................................................................. 189
Listing 67. Reading XML in ActionScript............................................................................................................. 193
Listing 68. HTML and JavaScript for Reading XML Example............................................................................ 197
Listing 69. Reading XML in Visual Basic............................................................................................................. 199
Listing 70. SCORM 1.2 API Methods.................................................................................................................... 202
Listing 71. SCORM 1.3/2004 API Methods......................................................................................................... 202
Listing 72. scorm.js File Used
in Flash, JavaScript, and Silverlight SCORM Examples............................... 214
Listing 73. SCORM Runtime Environment Communication
Code - Flash ActionScript.............................. 217
Listing 74. SCORM Runtime Environment Communication
Code - JavaScript............................................. 222
Listing 75. SCORM Runtime Environment Communication
Code - Silverlight............................................. 227
Listing 76. Drag & Drop Implementation
Code - ToolBook OpenScript........................................................ 231
Listing 77. Drag & Drop Implementation
Code - Flash.................................................................................... 234
Listing 78. HTML for Drag &
Drop Example........................................................................................................ 236
Listing 79. Drag & Drop Implementation
Code - JavaScript............................................................................ 238
Listing 80. XAML for Drag &
Drop Example........................................................................................................ 240
Listing 81. Drag & Drop Implementation
Code - Silverlight............................................................................ 241
Listing 82. Glossary Web Service Implementation
Code................................................................................. 245
Listing 83. Glossary Implementation
Code - ToolBook OpenScript.............................................................. 247
Listing 84. Glossary Implementation
Code - Flash........................................................................................... 254
Listing 85. CSS and HTML for Glossary Example............................................................................................... 256
Listing 86. Glossary Implementation
Code - JavaScript.................................................................................. 258
Listing 87. Glossary Implementation
Code - Silverlight.................................................................................. 261
Listing 88. Calculator Implementation
Code - ToolBook OpenScript........................................................... 266
Listing 89. Calculator Implementation
Code - Flash........................................................................................ 276
Listing 90. Style Sheet and HTML Snippets for
Simple Calculator................................................................. 280
Listing 91. Calculator Implementation
Code - JavaScript............................................................................... 282
Listing 92. Resource Definitions and
XAML Snippet for
Simple Calculator................................................. 286
Listing 93. Calculator Implementation
Code - Silverlight............................................................................... 288
Listing 94. Score Method Implementation
(Visual Basic)............................................................................... 310
Listing 95. Score Method Implementation
(ActionScript)............................................................................... 310
Listing 96. Custom Property Definition............................................................................................................... 311
Listing 97. Overloaded Subroutine in
ToolBook and Visual Basic .NET....................................................... 314
Listing 98. Sample Constructor Methods........................................................................................................... 315
Listing 99. Page-Level Script for the ToolBook Object-Oriented
Programming Sample Application...... 320
Listing 100. Animal.sbk Book Script Implementing Both Redirection and
“Base Class” Code................. 323
Listing 101. Script for "Cat" Page......................................................................................................................... 324
Listing 102. Implementation Code for Flash Object-Oriented
Programming Sample Application......... 328
Listing 103. Animal Class Implementation
- ActionScript.............................................................................. 330
Listing 104. Dog Class Inherited from the Animal Class in Flash................................................................. 332
Listing 105. Implementation Code for Silverlight Object-Oriented
Programming Sample Application. 336
Listing 106. Animal Class Implementation
- Visual Basic.............................................................................. 339
Listing 107. Cat Class Inherited from the Animal Class in Silverlight.......................................................... 340