TAILIEUCHUNG - Foundation Flash CS4 for Designers- P23

Foundation Flash CS4 for Designers- P23: I can remember the day as clear as if it were just yesterday. I was walking by my boss’s office late one winter afternoon at the college where I teach, and he called me into his office. Sitting on his desk was a thin, white box with some sort of weird swirl on it. He slid the box across to me and asked, “You know anything about Flash?” | CHAPTER 15 The createLetter function is how the letters arrive in the movie. The first variable fmt creates a TextFormat instance which is used to format text fields as you learned in Chapter 6. With the fmt instance created we need to give it some formatting information. The size of the text is set by using a custom function randomBetween which determines the maximum and minimum size of the letters. That function is coming in step 4. The color is set by picking a random value between 0 and 1 and then multiplying that result by 16 777 216. Where did that number come from That s how many colors you can find in the 24-bit color space. We then create a movieclip and add a text field to its display list. Before it is added to the display list the text field is centered and random letters are added to it. That s accomplished with this line randomBetween 97 122 This looks rather complex but it makes sense when you break it down. We needed random values so we reused that randomBetween function and told it to return a value between and inclusive of 97 and 122. What numbers are those Those represent ASCII values for the lowercase letters a through z. The method converts those into their corresponding characters. The next two lines tell Flash to apply the text formatting to the text field fmt and finally to add the text field to the movieclip s display list t . The remainder of the code tells Flash where to position the text-containing movieclip including the configuration of two custom properties ang and range used in an event handler function you re about to write . The final line tells Flash to animate the movieclip by using a custom shimmy function. Let s write that function. 3. Press Return Enter twice and enter the following code which puts the letters in motion function shimmy evt Event void var mc MovieClip MovieClip - randomBetween 6j 10 .

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.