Adobe Flash Professional CS6 Adobe Flash Professional CS6 Classroom In A Book | Page 291
Testing the calculator
Now test your movie to see how Flash controls the contents of the named text boxes.
1 Choose Control > Test Movie > in Flash Professional.
2 In the preview movie that appears, enter new values in the text boxes next to
RATE and PERCENT DOWN, and then click the Calculate button.
Flash reads the values in the text boxes next to Rate and Percent Down,
calculates a monthly payment, and displays new text in the text box next to
MONTHLY PAYMENTS. Try different values to see how much you can afford!
Loading external Text
So far, you’ve created an attractive layout with an interactive tool for this property
listing for the real estate agent. However, the agent has many more listings, and
it would be convenient to use the same layout to display the information without
re-creating it for each property. Fortunately, you can load new text from an external
file and display it in an existing text box, replacing its contents. To display addi-
tional listings, simply maintain additional text files and load them to be displayed
as needed. This is an example of dynamic content—content that changes at runtime
(in the SWF file) rather than being fixed during authortime (in the FLA file).
In this section, you’ll load new content from external text files to replace the prop-
erty address, information, and description.
naming the text boxes
To change the contents of the text boxes, you first need to give them instance
names so they can be referenced in ActionScript. You’ll provide instance names
for the address, information, and description of the property listing.
1 Select the text box at the top of the Stage that contains the address of the
property listing.
282
Lesson 7
Using Text