Click to go to the home page.

This Document
"7: Open a Window" Behavior
Parameter Dialog Box

See Also
The "Rollover" Behavior
Writing Mouse Handlers

 

Site Nav

css drop down menu by Css3Menu.com

7: Open a Window

"7: Open a Window" behavior

Click to go to top of this section. What it does

This behavior opens a window or the root of a menu system. You should make sure that when the user clicks a sprite with this behavior, the multi-sprite it tries to open is instantiated. If it isn't instantiated, WFS opens an alert dialog box to help you debug.

If you want to open a submenu, use the Menu Verb behavior, not this one.

Click to go to top of this section. What to attach it to

The sprite you drop this on can be any sprite. It doesn't have to be part of a multi-sprite.

Click to go to top of document. The Parameter Dialog Box

When you drag the "7: Open a Window" behavior onto a sprite, the following dialog box opens. Click on a particular item for documentation on it.  

Click to go to top of this section. What event should open the multi-sprite?

The first drop down, which defaults to "mouseUp", determines what mouse event will open the window. Note that the options are:

  1. mouseEnter
  2. mouseDown
  3. mouseUp
  4. mouseLeave
  5. rightMouseDown (Control+click in Macs)

Of note is the "rightMouseDown" option. You can open windows with rightMouseDown (Control+click in Macs), but usually this is reserved for opening pop-up menus (using the "Menu Verb" behavior on menu items), which Windows For Shockwave supports in menu creation. However, if you select "rightMouseDown" then you need to uncheck the File > Publish Settings > Shockwave Save > Context Menu checkbox. This is so the Shockwave Context Menu is not displayed when you right click in the final Shockwave piece, if you are making Shockwave (versus a Projector).

The reason that opening on rightMouseDown is generally reserved for a pop-up menu is that, typically, in applications that employ right mouse pop-up menus, the way to close the pop-up is to click away from the menu or click on a menu item. And that's how menus behave in WFS. Whereas to close a window, you generally provide a button on the window that closes the window.

Click to go to top of this section. Name of the multi-sprite you want to open.

Specify the name of the multi-sprite you want to open. Make sure that this multi-sprite is instantiated whenever the user can click to open the window. If it isn't, WFS will issue you an error message to help you debug.

Click to go to top of this section. Specify where you want the multi-sprite opened

The box that defaults to "Do not move it, just open it" contains the following options:

  1. Do not move it, just open it.
  2. Center it.
  3. Open it where mouse is.
  4. Open at absolute location.

The "Do not move it, just open it" option opens the multi-sprite where you designed it to be, or where it was when the user last moved it, if it has a handle that allows the user to drag it around.

The "Center it" option centers it on the stage every time this behavior opens the multi-sprite. Be aware that WFS uses the multi-sprite background sprite as the reference sprite to center the multi-sprite. The background sprite is the first Element below the Manager in the Score.

The "Open it where mouse is" option opens it so that the top left point of the multi-sprite background sprite (the sprite right after the Window Manager in the Score) is where the mouse is.

The "Open at absolute location" option opens the multi-sprite so that the top left point of the multi-sprite background sprite (the sprite right after the Window Manager in the Score) is at the absolute point you specify with the two sliders in the Parameter Dialog Box.

Click to go to top of this section. If you chose 'Open at absolute location', specify horizontal value

If you specify "Open at absolute location", then and only then do you need to set the last two options in the dialog box that have sliders associated with them. Setting the sliders has no effect unless "Open at absolute location" is selected. This particular slider sets the horizontal value of the absolute point at which the multi-sprite will be opened.

Click to go to top of this section. If you chose 'Open at absolute location', specify vertical value

If you specify "Open at absolute location", then and only then do you need to set the last two options in the dialog box that have sliders associated with them. Setting the sliders has no effect unless "Open at absolute location" is selected. This particular slider sets the vertical value of the absolute point at which the multi-sprite will be opened.

 

Click to go to the home page7: Open a Window