TAILIEUCHUNG - Dynamically Creating and Configuring Text Fields

Tạo và Cấu hình tự động văn bản nhập Mặc dù bạn đang trình bày với một loạt các lựa chọn khi tạo và cấu hình các trường văn bản trong môi trường authoring, có thể tạo ra các lĩnh vực văn bản trên fly-trong khi phim của bạn đang chạy, cho phép bạn kiểm soát lớn hơn trong dự án của bạn cách xử lý văn bản. Chúng ta hãy nhìn vào quá trình tạo năng động. | Dynamically Creating and Configuring Text Fields Although you re presented with a variety of options when creating and configuring text fields in the authoring environment being able to create text fields on the fly while your movie is running gives you even greater control over the way your project handles text. Let s take a look at the dynamic creation process. To create a text field using ActionScript you use the createTextField method as follows createTextField instanceName depth x y width height Now note the following example which uses the createTextField method to create a text field createTextField myField_txt 10 20 50 200 30 This script creates a text field named myField_txt with its initial depth x y width and height properties set as shown. Every text field whether placed on the stage while authoring the movie or created dynamically is considered an instance of the TextField class. As such text fields can be treated in several ways similarly to movie clip instances. Individual text fields are given instance names from the Property Inspector or when created dynamically as shown in the preceding code . When targeting a text field instance with a script you use its target path which includes its instance name. You may not be able to tell by looking at the Actions toolbox in the Actions panel but several methods similar to Movie Clip object methods are available to text field instances. For example this script makes the myField_txt text field draggable startDrag myField_txt true Unlike movie clips text fields are not timelines therefore certain methods such as prevFrame attachMovie loadMovie and so on have no meaning when used in the context of a text field instance. Text field instances have several properties similar to those of movie clips. For example 50 makes the myField_txt text field 50 percent transparent. With a little bit of experimentation you ll be able to see which methods and properties are shared by movie clip and text field

TÀI LIỆU MỚI ĐĂNG
10    187    1    27-06-2024
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.