package { import flash.display.*; import flash.events.*; public class Wk3TempConverter extends MovieClip { function Wk3TempConverter( ) { // TASK: Listen for a Mouse Click event to compute wage per hour ComputeBtn.addEventListener(MouseEvent.CLICK, ComputeCelsius ); } function ComputeCelsius( event: MouseEvent ) { // TASK 1: Variable Declarations var fahrenheit: Number; var celsius: Number; // TASK 2: Gather Input fahrenheit = Number( InputTemp.text ); // TASK 3: Compute Result // Formula for conversion to celsius: [°C] = ([°F] − 32) × 5⁄9 celsius = (fahrenheit - 32) * (5 / 9); // TASK 4: Display Result // Display the result in the Movie, as well as tracing it in the Output Window trace( fahrenheit + " degrees fahrenheit is " + celsius + " degrees celsius" ); OutputTemp.text = fahrenheit + " degrees fahrenheit is " + celsius.toFixed(1) + " degrees celsius"; } } }