MACROMEDIA FLASH 8-DEVELOPING FLASH LITE 2.X Develop Manual page 43

Developing flash lite 2.x applications
Hide thumbs Also See for FLASH 8-DEVELOPING FLASH LITE 2.X:
Table of Contents

Advertisement

To create the text field example application:
1.
In Flash, create a new document from the Flash Lite 2.0 Generic template that you created
earlier (see "Creating a Flash Lite document template (Flash Professional only)" in Getting
Started with Flash Lite 2.x), and save it as textfield.fla.
2.
Using the Text tool in the Tools panel, create a single-line text field across the top of the
Stage.
3.
With the text field still selected, 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, and type inputTxt in the Instance Name text box.
4.
Create another text field below the first that is several times taller than the first one, as
shown below:
5.
With the second text field selected, in the Property inspector, select Dynamic Text from
the Text Type pop-up menu, select Multiline from the Line Type pop-up menu, select the
Render Text as HTML option, select Use Device Fonts from the Font Rendering Method
pop-up menu, and type messageTxt in the Instance Name text box.
6.
In the Timeline, select Frame 1 on Layer 1.
7.
Open the Actions panel (Window > Actions) and enter the following code:
Selection.setFocus(inputTxt);
fscommand2("SetFocusRectColor", 0, 0, 0);
inputTxt.onChanged = function() {
messageTxt.htmlText = "You entered: <i>" + this.text + "</i>";
}
The
Selection.setFocus()
(
). Next, the
inputTxt
color. Last, the input text field's
the input text field changes, formats and displays the text that the user entered in the
text field.
messageTxt
8.
Save your changes and start the application in the emulator (Control > Test Movie).
Input text field
method sets the initial focus to the input text field
function call specifies a custom focus rectangle
fscommand2()
event handler, called whenever the contents of
onChanged
Text field example application (Flash Professional only)
43

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-DEVELOPING FLASH LITE 2.X and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents