Creating Custom Context Menus

Standard menu. Xuất hiện khi bạn kích chuột phải vào bất cứ điều gì trong một bộ phim Flash, ngoại trừ một trường văn bản. Hiệu chỉnh trình đơn. Xuất hiện khi bạn kích chuột phải vào một trường văn bản đó là có thể chỉnh sửa hoặc lựa chọn. Lỗi menu. Xuất hiện khi một bộ phim Flash không tải trong vòng một trang Web và phải bạn nhấp chuột vào vùng trống. | Creating Custom Context Menus The context menu appears when you right-click a Flash movie Control-click on a Macintosh . There are three different types of Flash context menus Standard menu. Appears when you right-click anything in a Flash movie except a text field. Edit menu. Appears when you right-click a text field that s editable or selectable. Error menu. Appears when a Flash movie fails to load within a Web page and you right-click in the empty area. The error menu cannot be changed but the standard and edit context menus can be customized to display new items or remove the built-in default items. All the built-in context menu items can be removed except for the Settings item and the Debugger item. The Flash player includes two built-in classes to assist you in creating a customized context menu ContextMenu. This class allows you to create a new context menu hide built-in menu items Zoom In Zoom Out 100 Play Stop and so on and keep track of customized items. ContextMenuItem. Each item in a context menu is an instance of this class. The ContextMenu class has a property array called customItems. Each element in that array is an instance of the ContextMenuItem class. The ContextMenu class and the ContextMenuItem class are used together to build custom context menus. When creating a new instance of the ContextMenu class you can specify a function to be called when that ContextMenu is displayed var myContextMenu ContextMenu new ContextMenu menuHandler The menuHandler function is executed just before the context menu appears. Script within the function can be used to evaluate certain conditions within the application and items on a context menu can be dynamically added removed enabled or disabled. For example a Save item may be disabled if nothing has changed since the last time the user saved. You can dynamically change the function a context menu calls before it appears by redefining its onSelect event handler. For example anotherFunction .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
60    1    1    10-06-2024
127    263    4    10-06-2024
Đã 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.