This section describes how to create a simple application that uses static, dynamic, and input text fields. The application asks the user (using text in a static text field) to provide their name (using an input text field). After they enter their name and select a button, the application shows a message (using a dynamic text field) addressed to the user.
To create a text field example application:
In Flash, create a new document from the Flash Lite 1-1 - Symbian Series 60 device template.
For more information about creating documents from device templates, see Using Flash Lite document templates in Getting Started with Flash Lite 1.x.
In the Timeline (Window > Timeline), select the first frame of the layer named ActionScript.
Open the Actions panel (Window > Actions).
Type stop(); in the Actions panel to stop the playhead on that frame.
Select the Text tool in the Tools panel to create a text field on the Stage that contains the text "Your name:".
With the new text field selected, in the Property inspector, select Use Device Fonts from the Font Rendering Method pop-up menu.
Create a new text field below the first one and, in the Property inspector, select Input Text from the text type pop-up menu, select Use Device Fonts from the Font Rendering Method pop-up menu, type nameVar in the Var text box, and select the Show Border Around Text option.
Select Window > Common Libraries > Buttons to open a library of prebuilt button symbols.
In the Buttons library, double-click the Circle Buttons folder to open it.
Drag an instance of the symbol named "circle button - next" to the Stage.
Using the Text tool create another text field at the bottom of the Stage.
This text field will display a message that contains the name the user enters in the input text field.
With the new text field selected, in the Property inspector, type message in the Var text box, select Dynamic from the Text Type pop-up menu, and select Use Device Fonts from the Font Rendering Method pop-up menu.
The Stage in your application should look similar to the following image:
Select the button on the Stage, and open the Actions panel (Window > Actions).
Enter the following code in the Actions panel:
on(press) {
message = "Hello, " add nameVar;
}
Select Control > Test Movie to test the application in the Adobe Device Central emulator.
Press the Down arrow on the emulator's keypad to give the input text field focus.
Press the Select key on the emulator to open the emulator's text input dialog box, and type your name using your computer's keyboard.
Press OK to close the input text dialog box.
Press the Down Arrow key on the emulator's keypad again to give focus to the button, and press the Select key.