Most of what comes into or out of Flash passes in some fashion through the File Menu. Publishing One of the most celebrated features of Flash 4 was the Publish feature, which replaced Aftershock. This is a powerful, robust aspect of Flash that required no changes in this upgrade to Flash 5. The areas of the File Menu which pertain to the Publish feature are:. Printing Although Flash is considered a Web and animation program, it fully supports printed output.
The functionality and specific dialogs vary slightly from the Mac to the PC while other variations are subject to which printers and printer drivers are installed on your machine. The Flash Page Setup dialog is the most standard aspect of the program and the choices for paper size, margins, center positioning, and orientation are pretty intuitive.
The options here are:. Preferences The Preferences dialog is one of the places where you get to tell Flash how you want it to behave. Nearly all options are identical on both platforms with the exception of the clipboard settings, which are a reflection of the different ways that the two platforms handle their clipboards.
Keyboard shortcuts There is one major reason to applaud the inclusion of this feature in Flash 5: It enables the disabled. Imagine how wonderful this facility might be for someone who has lost the use of one of his or her hands. For other disabilities, this feature could make the difference between the ability to work effectively in Flash or not. We have a friend who is a quadriplegic; having the use of neither his hands nor his feet, this intrepid fellow accomplishes amazing feats in Flash with a mouth stick!
These keyboard commands enable him, and others with disabilities, to use the program with a little more ease. Another reason to celebrate this feature is that it facilitates the development of a custom workflow for example, drawing tablet with one hand, keyboard with the other. The disadvantage of this feature is that, in a busy studio where artists are swapping seats like musical chairs, irresponsible keyboard changes can lead to team grief. In a studio, Keyboard Shortcuts must be implemented with regard for others working in the same environment.
Menu items have the two state properties, checked and enabled :. The data property of the NativeMenuItem class allows you to reference an arbitrary object in each item. About the FlexNativeMenu control. Adobe Flash Platform. View Help PDF 5. For a quick explanation and code examples of creating native menus in AIR applications, see the following quick start articles on the Adobe Developer Connection: Adding native menus to an AIR application The native menu classes allow you to access the native menu features of the operating system on which your application is running.
Menu classes The menu classes include: Package Classes flash. Application menus AIR only An application menu is a global menu that applies to the entire application. On Mac OS X, the operating system automatically creates an application menu.
You can add listeners for handling the existing menu commands. Or you can remove existing items. Window menus AIR only A window menu is associated with a single window and is displayed below the title bar. Menus can be added to a window by creating a NativeMenu object and assigning it to the menu property of the NativeWindow object.
Native window menus can only be used with windows that have system chrome. Dock and system tray icon menus AIR only These icon menus are similar to context menus and are assigned to an application icon in the Mac OS X dock or the Windows and Linux notification areas on the taskbar.
Dock and system tray icon menus use the NativeMenu class. On Mac OS X, the items in the menu are added above the standard operating system items. On Windows or Linux, there is no standard menu. Pop-up menus AIR only An AIR pop-up menu is like a context menu, but is not necessarily associated with a particular application object or component.
Pop-up menus can be displayed anywhere in a window by calling the display method of any NativeMenu object. Custom menus Native menus are drawn entirely by the operating system and, as such, exist outside the Flash and HTML rendering models. Such menus must be fully rendered inside application content. Native menu structure AIR Native menus are hierarchical in nature. View full size graphic. Menu events NativeMenu and NativeMenuItem objects both dispatch preparing , displaying , and select events: Preparing: Whenever the object is about to begin a user interaction, the menu and its menu items dispatch a preparing event to any registered listeners.
Name it "Button", choosing Button as the behavior. Choose the Rectangle tool, and select a medium green-colored fill.
In the center of the stage, draw a rectangle similar to the one in the example shown, about 50 pixels high by pixels wide. Highlight the "Over" frame, and press F6 to insert a keyframe here. Choose the Paint Bucket tool and select a dark green color from the palette. Apply the Paint Bucket to the rectangle, changing it to dark green.
This will make the button turn dark green while the cursor is over it, in the finished movie. Highlight the "Down" Frame, and press F6 to insert a keyframe. Choose light green as the Paint Bucket color, and apply it to the green rectangle. This will make the button turn light green while the button is pressed in the finished movie.
Create the Top Level menu:. Find "Button" in the Library, and drag a Button from the Library window to the upper left of the stage. Drag from the thumbnail preview of the Button in the window. Drag a second instance of Button from the Library window to the upper right of the stage. Line the two buttons up across the top of the stage, about pixels apart.
Choose the Text Tool. For the font, choose Arial, 24 point, White, Bold. Create a text block next to the first button that says "MENU 1". Do the same as above for the second button, and type "MENU 2". Using the Arrow tool, select and center the text on the buttons. Select frame 20 of the Top level buttons layer and press F6 to insert a keyframe. Lock this layer. Create the Submenu items. Highlight frame 10 of the Submenu buttons layer and press F6 to insert a keyframe. Drag another instance of the Button on the stage, centering it about 20 pixels below the last button.
The target and currentTarget properties of the event are both the object on which the listener is registered: either the menu itself, or one of its items. The preparing event is dispatched before the displaying event. You typically listen for one event or the other, not both. A select event bubbles up from a menu item to its containing menu, on up to the root menu. You can listen for select events directly on an item and you can listen higher up in the menu structure.
When you listen for the select event on a menu, you can identify the selected item using the event target property. As the event bubbles up through the menu hierarchy, the currentTarget property of the event object identifies the current menu object.
You can assign a key equivalent sometimes called an accelerator to a menu command. The menu item dispatches a select event to any registered listeners when the key, or key combination is pressed. The menu containing the item must be part of the menu of the application or the active window for the command to be invoked. Key equivalents have two parts, a string representing the primary key and an array of modifier keys that must also be pressed.
To assign the primary key, set the menu item keyEquivalent property to the single character string for that key. If you use an uppercase letter, the shift key is added to the modifier array automatically. On Windows and Linux, it is the control key Keyboard. These default keys are automatically added to the modifier array. To assign different modifier keys, assign a new array containing the desired key codes to the keyEquivalentModifiers property.
The default array is overwritten. Whether you use the default modifiers or assign your own modifier array, the shift key is added if the string you assign to the keyEquivalent property is an uppercase letter. Constants for the key codes to use for the modifier keys are defined in the Keyboard class.
The assigned key equivalent string is automatically displayed beside the menu item name. Mnemonics are part of the operating system keyboard interface to menus. Linux, Mac OS X, and Windows allow users to open menus and select commands with the keyboard, but there are subtle differences. On Mac OS X, the user types the first letter or two of the menu or command and then presses the return key. The mnemonicIndex property is ignored. On Windows, only a single letter is significant.
By default, the significant letter is the first character in the label, but if you assign a mnemonic to the menu item, then the significant character becomes the designated letter. Instead of pressing a single letter to select the menu or command, the user must press the letter as many times as necessary to highlight the desired item and then press the enter key to complete the selection.
To maintain a consistent behavior, you should assign a unique mnemonic to each item in a menu for window menus. On Linux, no default mnemonic is provided.
0コメント