TAILIEUCHUNG - Foundation Flash CS4 for Designers- P19

Foundation Flash CS4 for Designers- P19: 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 12 Now let s roll up our sleeves and use some of these properties 1. Open the file from the Exercise folder for this chapter. There are a few things already in place for you. Note the two dynamic text fields side by side with instance names unstyledContent and styledContent. There s also a bit of ActionScript in frame 1 of the scripts layer which does nothing more than build a string of HTML tags and apply that string to the property of the two text fields. 2. Test the movie to see two identical copies of the wasabi salmon recipe shown Figure 12-1 yup it s a real recipe . Figure 12-1. CSS is about to save you a lot of effort. When you use CSS in Flash the styling must be applied to a text field before any text is added to it. If you apply styling afterward you ll get mixed results or the styling won t work at all. We re going to leave the unstyledContent text field as is in order to have a running comparison. The CSS that formats the styled text field will need to appear before the last line of ActionScript styledContent. htmlText str because the last line actually provides the HTML text. 3. Put your cursor in front of the last line of code and press Enter Return three times. This is where the new ActionScript will go. Now hold that thought. How is this CSS thing going to work That s a good question and thankfully the answer isn t especially complicated even though the process takes a few steps. First you re going to create an instance of the StyleSheet class. Next you ll decide on a handful of style properties. You ll repeatedly use the method to associate those properties with an HTML tag. Finally you ll associate the StyleSheet instance itself with a given text field and add HTML content to that text field. The crafty thing is that there are a number of ways to handle the setStyle part. We re going to step you through a wordy approach first because we think it best summarizes on a conceptual level what

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.