Adobe Flash Professional CS6 Adobe Flash Professional CS6 Classroom In A Book | Page 289

3 Select the next Editable text box next to Percent Down. 4 In the Properties inspector, enter down_txt for the instance name. 5 Select the Read Only text box next to Monthly Payments. 6 In the Properties inspector, enter monthly_txt for the instance name. Changing the contents of text boxes The contents of a text box are represented by its text property. You can dynami- cally change a text box’s contents by assigning new text to the text property. In this section, you’ll add ActionScript that reads the text entered in the Editable text boxes next to Rate and Percent Down, perform some mathematical calculations, and then display new text in the Read Only text box next to Monthly Payments. 1 Unlock the calculator layer, select the Calculate button on the Stage, and in the Properties inspector, enter calculate_btn for the instance name. 2 Insert a new layer and rename it actionscript. 3 Select the first keyframe of the actionscript layer and open the Actions panel. 4 You must first create a few variables to hold numerical information. The variables will help you make the mortgage calculations. Variables are created, or “declared,” using the var keyword. Enter the code as follows: var term:Number=360; var price:Number=350000; var monthlypayment:Number; 280 Lesson 7 Using Text