Creating Dynamic Text Fields and Retrieving Information
Số trang: 6
Loại file: pdf
Dung lượng: 27.21 KB
Lượt xem: 14
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tạo Dynamic Text Fields và lấy thông tin trong Flash, có ba loại đối tượng văn bản: đầu vào tĩnh, và năng động. Bạn soạn văn bản tĩnh trên sân khấu sử dụng công cụ Text.
Nội dung trích xuất từ tài liệu:
Creating Dynamic Text Fields and Retrieving Information < Day Day Up >Creating Dynamic Text Fields and Retrieving InformationIn Flash, there are three types of text objects: static, input, and dynamic.You compose static text on the stage using the Text tool. However, because you cantchange the font, font size, or content of any static text area once an SWF file is created,you use static text for text that youll only need to change occasionally. Web sitenavigation buttons, for example, are good candidates for static text.Input text defines a text area that can be edited by users at run time. In other words, itswhere users enter text. Input text fields are generally employed to gather from the usertextual information that your movie uses or sends to a server for processing. This type oftext field is commonly found in Flash forms.A dynamic text field is a text area on the stage that can be populated, or filled with text asa movie plays—which means the text can change as the movie plays. A dynamic textfield can also be set to display simple HTML-formatted text. A news section of a FlashWeb site is a good example of where dynamic text would be useful. When you use adynamic text field to display HTML-formatted text, you set attributes such as color, font,and hyperlinks dynamically.NOTEAll input and dynamic text fields placed in a project are instances of the Text Fieldobject. As such, you can control and change them using properties and methods of thatclass.You configure text fields using the Property Inspector. If you select the text tool from theTools panel and open the Property Inspector from Window > Properties, youll see that itincludes a drop-down menu (at the top) where you can select one of the three text types(static, dynamic, or input). Depending on which text type you select, different textoptions are available.If you select Static Text from the drop-down list in the Property Inspector, you canchoose from these options: • Use Device Fonts. If you select this option, Flash will use fonts installed on the users computer rather than any special fonts youve included. • Selectable. If you select this option, the mouse cursor will change to an I-bar so that on mouse-over the text can be highlighted and copied. • Bold. Selected text is bolded. • Italic. Selected text is italicized. • Alignment. You can change the alignment of the text to be left-aligned, right- aligned, centered, or justified using the appropriate paragraph icon. • Text Orientation. Choose whether text in a static text field appears horizontally or vertically. • Format. Clicking this button brings up the Format Options dialog box, where you can adjust indenting, line spacing, and margins. • Character Display Attributes. You can choose the font, point size, and kerning for the text using this option. • Position Attributes. At the bottom-left of the Property Inspector is information about the screen position and the height and width of the text field. • URL Link. Enter a URL here to make the text field respond as regular hyperlinked text. • Alias Text. By default, this option is turned on. While on, the text in the selected text field is smoothed. When off, the text is not smoothed.If you choose Input Text from the drop-down list, you have these options: • Single Line, Multiline, Multiline No Wrap, Password. If you select Single Line, only one line of text can be entered in this text field. Additional options impose restrictions on the length of that line. If you select Multiline, multiple lines of text can be entered, and lines that exceed the width of the text field will automatically wrap to the next line. The Multiline No Wrap selection prevents text from wrapping. Text that extends beyond the boundaries of the text field is simply not shown. With Password selected, stars serve as visual replacements for anything you type (and the computer remembers the correct content). • Instance Name. Assigning instance names to input text and dynamic text fields lets you use ActionScript to control or access information from a text field. If you gave a text field an instance name of box_txt, for example, you could access its text using the reference box_txt.text. • Var. You can also give text fields variable names. When you assign a variable name directly to a text field, its contents always reflect the value of that variable. Likewise, if the text field is modified, the value of the variable changes to match the modified field. NOTE The ability to assign variables to text fields is a holdover feature from Flash 5. This functionality may be useful on rare occasions, but in most cases you should assign instance names to your text fields. This makes available a lot of scripting functionality not available to text fields when they have been assigned variable names. • HTML. Although input text fields are usually employed to accept user input, you can also use them to display dynamically generated text. If you select this option, the text field will be able to interpret any HTML 1.0 code (tags for bold, underline, and so on) thats included in the dynamic text that populates the field. • Border/Bg. If selected, this option will add a white background and black border to the text box—a useful way to automatically show where the text field is located on the screen. If you leave this option unselected, the user might not be able to see where the input field is located on the stage. • Maximum Characters. This option allows you to limit the number of characters that can be entere ...
Nội dung trích xuất từ tài liệu:
Creating Dynamic Text Fields and Retrieving Information < Day Day Up >Creating Dynamic Text Fields and Retrieving InformationIn Flash, there are three types of text objects: static, input, and dynamic.You compose static text on the stage using the Text tool. However, because you cantchange the font, font size, or content of any static text area once an SWF file is created,you use static text for text that youll only need to change occasionally. Web sitenavigation buttons, for example, are good candidates for static text.Input text defines a text area that can be edited by users at run time. In other words, itswhere users enter text. Input text fields are generally employed to gather from the usertextual information that your movie uses or sends to a server for processing. This type oftext field is commonly found in Flash forms.A dynamic text field is a text area on the stage that can be populated, or filled with text asa movie plays—which means the text can change as the movie plays. A dynamic textfield can also be set to display simple HTML-formatted text. A news section of a FlashWeb site is a good example of where dynamic text would be useful. When you use adynamic text field to display HTML-formatted text, you set attributes such as color, font,and hyperlinks dynamically.NOTEAll input and dynamic text fields placed in a project are instances of the Text Fieldobject. As such, you can control and change them using properties and methods of thatclass.You configure text fields using the Property Inspector. If you select the text tool from theTools panel and open the Property Inspector from Window > Properties, youll see that itincludes a drop-down menu (at the top) where you can select one of the three text types(static, dynamic, or input). Depending on which text type you select, different textoptions are available.If you select Static Text from the drop-down list in the Property Inspector, you canchoose from these options: • Use Device Fonts. If you select this option, Flash will use fonts installed on the users computer rather than any special fonts youve included. • Selectable. If you select this option, the mouse cursor will change to an I-bar so that on mouse-over the text can be highlighted and copied. • Bold. Selected text is bolded. • Italic. Selected text is italicized. • Alignment. You can change the alignment of the text to be left-aligned, right- aligned, centered, or justified using the appropriate paragraph icon. • Text Orientation. Choose whether text in a static text field appears horizontally or vertically. • Format. Clicking this button brings up the Format Options dialog box, where you can adjust indenting, line spacing, and margins. • Character Display Attributes. You can choose the font, point size, and kerning for the text using this option. • Position Attributes. At the bottom-left of the Property Inspector is information about the screen position and the height and width of the text field. • URL Link. Enter a URL here to make the text field respond as regular hyperlinked text. • Alias Text. By default, this option is turned on. While on, the text in the selected text field is smoothed. When off, the text is not smoothed.If you choose Input Text from the drop-down list, you have these options: • Single Line, Multiline, Multiline No Wrap, Password. If you select Single Line, only one line of text can be entered in this text field. Additional options impose restrictions on the length of that line. If you select Multiline, multiple lines of text can be entered, and lines that exceed the width of the text field will automatically wrap to the next line. The Multiline No Wrap selection prevents text from wrapping. Text that extends beyond the boundaries of the text field is simply not shown. With Password selected, stars serve as visual replacements for anything you type (and the computer remembers the correct content). • Instance Name. Assigning instance names to input text and dynamic text fields lets you use ActionScript to control or access information from a text field. If you gave a text field an instance name of box_txt, for example, you could access its text using the reference box_txt.text. • Var. You can also give text fields variable names. When you assign a variable name directly to a text field, its contents always reflect the value of that variable. Likewise, if the text field is modified, the value of the variable changes to match the modified field. NOTE The ability to assign variables to text fields is a holdover feature from Flash 5. This functionality may be useful on rare occasions, but in most cases you should assign instance names to your text fields. This makes available a lot of scripting functionality not available to text fields when they have been assigned variable names. • HTML. Although input text fields are usually employed to accept user input, you can also use them to display dynamically generated text. If you select this option, the text field will be able to interpret any HTML 1.0 code (tags for bold, underline, and so on) thats included in the dynamic text that populates the field. • Border/Bg. If selected, this option will add a white background and black border to the text box—a useful way to automatically show where the text field is located on the screen. If you leave this option unselected, the user might not be able to see where the input field is located on the stage. • Maximum Characters. This option allows you to limit the number of characters that can be entere ...
Tìm kiếm theo từ khóa liên quan:
máy tính mạng máy tính internet phần mềm ứng dụng lập trình SQL HTML sever web XMLGợi ý tài liệu liên quan:
-
Giáo án Tin học lớp 9 (Trọn bộ cả năm)
149 trang 267 0 0 -
Ngân hàng câu hỏi trắc nghiệm môn mạng máy tính
99 trang 252 1 0 -
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 2
102 trang 248 0 0 -
Bài giảng: Lịch sử phát triển hệ thống mạng
118 trang 246 0 0 -
47 trang 240 3 0
-
Đề cương chi tiết học phần Thiết kế và cài đặt mạng
3 trang 235 0 0 -
80 trang 221 0 0
-
122 trang 215 0 0
-
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 1
122 trang 214 0 0 -
Giáo trình môn học/mô đun: Mạng máy tính (Ngành/nghề: Quản trị mạng máy tính) - Phần 1
68 trang 204 0 0