
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
308
|
Chapter 12: Using Components with ActionScript 2.0
Once the converted amount has been calculated, we display it in the result TextArea
component, as follows:
result.text = "Result: " + convertedAmount;
When no currency has been selected, we display a warning in the result component:
result.text = "Please select a currency.";
Similarly, when the amount entered in the input component is not valid, we display a
warning in the
result component:
result.text = "Original amount is not valid.";
Exporting the Final Application
Our currency converter application is ready for testing and deployment. To specify
the name of the movie to create (CurrencyConverter.swf), follow these steps:
1. With CurrencyConverter.fla open, choose File
➝ Publish Settings ➝ Formats.
2. Under the File heading, for Flash (.swf), enter
../deploy/CurrencyConverter.swf.
3. Click OK.
4. To test our application in the Flash authoring tool’s Test Movie mode, select
Control
➝ Test Movie.
For our application, we’ll export to Flash Player 7 format (the default in Flash MX
2004), but you could also export to Flash Player 6 format if you expect your visitors
to be using that version of the Flash Player. The v2 components officially require
Flash Player 6.0.79.0 or higher, but in my tests the currency converter application
worked happily ...