Click to go to the home page.

This Document
"Close A Window" Behavior
Parameter Dialog Box
Public Handlers

See Also
"Close My Window" Behavior
"Menu Verb" Behavior
Writing Mouse Handlers

 

Site Nav

css drop down menu by Css3Menu.com

Close A Window

"Close A Window" Behavior

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

Attach this behavior to a sprite that you want to act as a button to close a window or the root of a menu. You will be prompted to specify the event that should trigger the closing of the multi-sprite and you will be prompted to cough up the name of the multi-sprite you want to close. If the multi-sprite isn't instantiated, an alert dialog is raised for debugging purposes.

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

Attach this to any sprite you want to close a window or close the root of a menu. The sprite to which you attach "Close A Window" does not have to be an element of a window or menu.

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

When you drag and drop a copy of the "Close A Window" behavior on a sprite, the following dialog box opens.

You specify whether the multi-sprites (and open descendants) will be closed on mouseEnter, mouseDown, mouseUp, or mouseLeave and you specify the name of the multi-sprite you want to close.

Note that the mouseLeave option works OK if there are no other sprites over the target sprite, but if there are sprites over the sprite you drop this behavior on, then you will have to check it out and see if it works OK in all circumstances.

Public Handlers

wfsGetWindowToClose
wfsSetWindowToClose
wfsGetCloseEvent
wfsSetCloseEvent

Click to go to top of document. 'Close A Window' Public Handlers

Click to go to top of this section. wfsGetWindowToClose (nameOrSpritenum)

Returns the name or spritenum of the window this behavior is supposed to close. If nameOrSpritenum is not specified, then the name is returned. If nameOrSpritenum <> VOID, then the spritenum of the window is returned (or 0 if the window is not currently instantiated). In the below, x is the spritenum of the sprite to which the 'Close A Window' behavior is attached.

windowToClose=sprite(x).wfsGetWindowToClose(nameOrSpritenum) or
windowToClose=sendSprite(x, #wfsGetWindowToClose, nameOrSpritenum)

EXAMPLES

windowToClose=sprite(x).wfsGetWindowToClose()

windowToClose is the name of the window to close.

windowToClose=sprite(x).wfsGetWindowToClose(1)

windowToClose is the spritenum of the manager of the window to close.

Click to go to top of this section. wfsSetWindowToClose (nameOrSpritenum)

Sets the window this behavior is supposed to close to nameOrSpritenum. If nameOrSpritenum is a string, then it should refer to a manager name (instantiated or not). If nameOrSpritenum is an integer, it should refer to the spritenum of an instantiated manager. In the below, x is the spritenum of the sprite to which the 'Close A Window' behavior is attached.

sprite(x).wfsSetWindowToClose(nameOrSpritenum) or
sendSprite(x, #wfsSetWindowToClose, nameOrSpritenum)

EXAMPLES

sprite(x).wfsSetWindowToClose("some window")

windowToClose is set to "some window".

sprite(x).wfsGetWindowToClose(34)

windowToClose is set to the window whose manager is sprite 34.

Click to go to top of this section. wfsGetCloseEvent ()

Returns the event that closes the window.
Range: "mouseEnter", "mouseDown", "mouseUp", "mouseLeave"

closeEvent=sprite(x).wfsGetCloseEvent() or
closeEvent=sendSprite(x, #wfsGetCloseEvent)

Click to go to top of this section. wfsSetCloseEvent (theEvent)

Sets the event that closes the window.
Range of theEvent: "mouseEnter", "mouseDown", "mouseUp", "mouseLeave"

sprite(x).wfsSetCloseEvent(theEvent) or
sendSprite(x, #wfsSetCloseEvent, theEvent)

 

Click to go to the home pageClose A Window