• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Controlling Text > TextField Properties

TextField Properties

When you drag an input or dynamic text field on the Stage with the Text tool, you are creating an instance of the TextField class. Before you can have access to its methods and properties, however, you must name your text field in the Property Inspector so that you can identify it with ActionScript.

The instance name of a text field is very different from its variable name (Figure 10.31). The variable name simply holds the contents of the text field. The instance name, on the other hand, identifies the text field for targeting purposes. When you can target the text field, you can evaluate or modify its many properties. These properties determine the kind and display of the text field. You’ve already used the text property, to get and set the contents of text fields. The text property holds the current contents of a text field. So the statement myTextField_txt.text = "Congratulations!" would display the string Congratulations! in the text field called myTextField_txt. There are many other properties. For example, you’ve encountered the html Text and html properties as well. Other properties include type, which defines an input or dynamic text field; border, which determines whether the text field has one; and _rotation, which controls the angle of the text field.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint