Dynamically Populating the Text Area
Now that you've created the text area and all the button hotspots, you can write the script that makes the map functional.
1. | Select Frame 1 of the actions layer, and open the Actions panel. Add the following script below all the existing script: upperHell_btn.onRelease = function() { |
If you want to copy and paste this text string, it's listed under the heading Upper Hell in script_infern228.txt.[View full size image]

2. | Choose Control > Test Movie, and click Upper Hell. |
The text string dutifully changes, which is pretty cool. What is even cooler is that Flash automatically adds a scrollbar to accommodate the text that doesn't fit in the text area.[View full size image]

3. | Return to the authoring environment, and use the script for upperHell_btn as a model to write five other scriptsone each for the remaining buttons (limbo_btn, lust_btn, and so on). Use the text in script_infern228.txt as the source. |
[View full size image]

4. | Save and test the movie. Click each of the labels to make sure the text area's contents are correctly populated. |
As you work through this step, you'll probably notice that if you read one description and scroll down to the bottom, and then click another label, the description remains scrolled to the bottom. It would be more attractive, not to mention usable, if the text area returned to the top every time the user clicked one of the labels.You can achieve this behavior by adding a simple line of ActionScript to each of the six button functions.[View full size image]

5. | Return to the authoring environment. In the Actions panel with Frame 1 of the actions layer in the timeline selected, enter the following script before the line that begins upperInfo_txt.text = on each of the buttons. upperInfo_txt.vPosition = 0; |
The property vPosition is built into the TextArea object. It defines the vertical position of the text. By setting it to 0, you ensure that the first line of text appears at the top of the text area.[View full size image]

6. | Save and test the movie. |
Try clicking each of the labels and scrolling the text area down to the bottom for each one. Regardless of the current position of the scrollbar, clicking one of the labels should immediately show that label's text, and it should start at the top.