TAILIEUCHUNG - Học Actionscript 3.0 - p 44

An XML-Based Navigation System 26 27 28 29 30 31 32 33 _xml = new XML(); initLoader(); initMenus(); } catch (err:TypeError) { trace("Can't parse loaded content as XML:", ); } } N OT E The initLoader() method creates an instance of the SafeLoader class (line 36), positions it below the future location of the menus (line 37), and adds it to the display list (line 38). It also draws a 750 × 450 pixel movie clip (lines 40 through 44), adjusts its y position to 100, the same location as the SafeLoader instance (line 45), and uses it to mask the loaded content (line 46). 34 35 36 37 38 39 40 41 42 43 44 . | An XML-Based Navigation System 26 27 28 29 30 31 32 33 _xml new XML initLoader initMenus catch err TypeError trace Can t parse loaded content as XML The initLoader method creates an instance of the SafeLoader class line 36 positions it below the future location of the menus line 37 and adds it to the display list line 38 . It also draws a 750 X 450 pixel movie clip lines 40 through 44 adjusts its y position to 100 the same location as the SafeLoader instance line 45 and uses it to mask the loaded content line 46 . NOTE Using a mask prevents loaded content from appearing outside the area dedicated for its display something that frequently happens when assets follow the mouse for example. If you want to see what the project looks like without a mask at any point simply comment out line 46 when testing. 34 35 36 37 38 39 40 41 42 43 44 45 46 47 loader and mask private function initLoader void _loader new SafeLoader 100 _loader var loaderMask MovieClip new MovieClip var g Graphics 0x000000 1 0 0 750 450 100 loaderMask NOTE See Chapter 13 for information about a modification made to Adobe s SafeLoader class. The initMenus method creates an instance of the NavigationBarXML class lines 50 and 51 and adds it to the display list line 52 . In doing so it passes the scope of the document class into the constructor as well as the menus XMLList. This makes all of the menu XML data available to the class so it can create the necessary buttons. The method also creates a DropShadowFilter instance line 54 sets its alpha to 25 percent and adds it to the _navBar instance. This will give the entire menu system including the submenus that appear interactively a drop shadow. 48 navigation menu bar 49 private function initMenus void 50 var _navBar NavigationBarXML 51 new NavigationBarXML this 52 _navBar 53 54 var ds DropShadowFilter new

TÀI LIỆU MỚI ĐĂNG
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.