Click to go to the home page.

See Also
"Dynamism" script
"Dynamism" constructors
"Dynamism" destructors
"Script Writer" movie script

 

Site Nav

css drop down menu by Css3Menu.com

Dynamism Attachers

The "Dynamism" Attachers

The Dynamism Attachers are handlers stored in the WFS "Dynamism" script. They are handlers that attach behaviors to (dynamic or static) sprites at run-time.

The easiest way to generate code to attach behaviors dynamically to sprites is to create a static model of the sprite and attach the behavior to the sprite via the static drag and drop method. Then use a Script Writer public handler (wfsWriteBehaviorCode is perhaps most relevant here) to generate code for what you want to do. Then detach the behavior from the static sprite, insert the generated code in your code, and run it. This saves you having to configure most of the parameters of the below handlers.

The problem with the below handlers is that you have to specify a lot of parameters, ie, they are some work to use. Which is why the Script Writer handlers were written: to make writing WFS dynamic code much easier. Pay special attention to wfsAttachBehavior, below.

wfsAttachBehavior is a robust handler that attaches any script to any sprite, whether the sprite is dynamic or not, and initializes the behavior, whereas all the other handlers listed above are for attaching a specific behavior. So you are best to get to know how to use wfsAttachBehavior.

wfsAttachBehavior does the following:

  1. creates a dynamic behavior object,
  2. runs the behavior's 'on new' handler, if it exists
  3. initializes the Property Description List properties, if there are any, configurably
  4. initializes, configurably, any non PDL properties you want initialized before the beginSprite handler runs (if it exists)
  5. and runs the beginSprite handler, if the behavior has one.

Click to go to top of section. wfsAttachBehavior (aScriptName, aSprite, aOverride)

FUNCTION

This attaches a behavior to a sprite. Specifically, it attaches the behavior named aScriptName to aSprite. This is a general-use handler.

  1. wfsAttachBehavior first calls the 'new' handler, if the script has one.
  2. wfsAttachBehavior then initializes the Property Description List properties of the behavior, if any exist, to the default values (your Property Description List handlers must define default values for your PDL properties) unless you specify the optional aOverride parameter. The aOverride parameter allows you to give the PDL properties (and/or other properties of the script not in the PDL) initial values.
  3. wfsAttachBehavior then calls the beginSprite handler of the script, if it has one.
  4. wfsAttachBehavior then attaches the script to the sprite.
  5. wfsAttachBehavior then returns a reference to the script.

You can use wfsAttachBehavior to attach behaviors to dynamic or static sprites. You can use wfsAttachBehavior rather than any of the below attacher handlers; they simply make a call to wfsAttachBehavior, as you can see if you look at the WFS code in the "Dynamism" script.

I am indebted to Robert Tweed for the first version of this code: thanks Robert!

PARAMETERS

aScriptName: The string name of the behavior you want to attach to aSprite. You must have a copy of this behavior in a Cast for this handler to work properly.

aSprite: This is the sprite channel (integer) in which the sprite is located that you want to attach the behavior to. Alternatively, it can be a reference to the sprite as in sprite(4)

aOverride: This parameter is optional. Use it to override default values of PDL properties, if you want. aOverride is a property list. Specify the property names you want to override and a value for each of them. Example:
[#pSomeProperty: "text1", #pSomeOtherProperty: "text2", #pnonPDLprop:5]
You can also include non PDL properties in aOverride. If you don't specify any aOverride parameter, then if theScriptName contains a getPropertyDescriptionList handler, all the PDL properties will be initialized to the default values specified in the getPropertyDescriptionList handler.

RETURN VALUE

Returns 0 if aSprite is not an integer or a reference to a sprite. Returns a reference to the script, otherwise. So that if you run

theResult=wfsAttachBehavior("My Script", 78)

and the attachment was successful (ie, "My Script" exists and there is a sprite 78) and, say, "My Script" contains property pMyProperty, then theResult.pMyProperty tells you the value of pMyProperty.

EXAMPLE

theResult=wfsAttachBehavior("My Script", 78)

The above example attaches the "My Script" behavior to sprite 78. If there is an 'on new' handler, it runs. If there are PDL properties in "My Script", they are initialized to their default values. If there is a beginSprite handler, it is run.

theResult=wfsAttachBehavior("My Script", 78, [#pMyProperty1:45])

The above example does the same as the first example except that, supposing "My Script" contains a property called pMyProperty1, it is initialized to 45 rather than whatever the pMyProperty1 default value is (if pMyProperty1 is in the getPropertyDescriptionList handler).

Click to go to top of section. wfsAttachMenuVerb (theElementSpriteNum, OpenAMenu, NameOfMenuToOpen, MenuOpeningLocation, MenuAbsoluteLocH, MenuAbsoluteLocV, Highlight, HorizontalLeftOffset, HorizontalRightOffset, HighlightLocZOffsetText, CloseMenuOnMouseEvent)

FUNCTION

This attaches the "Menu Verb" behavior to the theElementSpriteNum and configures it according to the parameters. You need a copy of the "Menu Verb" behavior in your cast for this to work.

When you attach the "Menu Verb" behavior to a sprite via the non-dynamic method of dragging and dropping the behavior onto a sprite in the Score, you see the following Parameter Dialog Box (shown below with the default values):

This appears as a result of the getPropertyDescriptionList handler defined in the Menu Verb behavior code.

What you are doing when you specify the below parameters in wfsAttachMenuVerb is specifying these same properties at the command-line level rather than in the above Parameter Dialog box. Additonally, you have to specify theElementSpritenum, which is the sprite you want to attach the behavior to.

PARAMETERS

You have to specify theElementSpriteNum, but concerning the rest of the parameters, you only have to specify those that differ from the default value.

theElementSpriteNum: This is the spritenum of the sprite to which you want the "Menu Verb" behavior attached. The sprite should be an element of a menu.

OpenAMenu: Specify whether you want a window/menu opened or not and, if so, the mouse event to open it.
Parameter name in code: pWFSOpenAMenu
Range: "no", "mouseEnter", "mouseDown", "mouseUp", "mouseLeave", "rightMouseDown"
Default: "no"

NameOfMenuToOpen: Specify the name of the multi-sprite you want opened, or "" if no window/menu is to be opened.
Parameter name in code: pWFSNameOfMenuToOpen
Range: the (string) name of any multi-sprite
Default: the empty string, ie, ""

MenuOpeningLocation: Specify where you want the window/menu opened or "Don't want one opened." if no window/menu is to be opened.
Parameter name in code: pWFSMenuOpeningLocation
Range: "Don't want one opened.", "Do not move it, just open it.", "Center it.", "Open it where mouse is.", "Absolute location."
Default: "Don't want one opened."

MenuAbsoluteLocH: If you specified MenuOpeningLocation="Absolute location." then this integer parameter is meaningful and describes the horizontal component of where the menu/window will be opened.
Parameter name in code: pWFSMenuAbsoluteLocH
Range: integer
Default: 0

MenuAbsoluteLocV: If you specified MenuOpeningLocation="Absolute location." then this integer parameter is meaningful and describes the vertical component of where the menu/window will be opened.
Parameter name in code: pWFSMenuAbsoluteLocV
Range: integer
Default: 0

Highlight: This boolean specifies whether you want the menu item highlighted on mouseEnter. If so, then you must have a copy of the two 'Menu item highlight' WFS library elements in a Cast. If Highlight=1, then WFS auto creates a 'Menu item highlight vector' sprite (concerning dynamic sprites) and attaches the 'Menu item highlight' behavior to it.
Parameter name in code: pWFSHighlight
Range: boolean
Default: 1

HorizontalLeftOffset: Specify the number of pixels the highlight will start from the left of the menu item. Postive values start the highlight further to the left than the menu item. Negative values make the highlight start to the right of the left side of the menu item. The value of 0 makes the highlight start at the same left point as the menu item itself.
Parameter name in code: pWFSHorizontalLeftOffset
Range: integer
Default: 0

HorizontalRightOffset: Specify the number of pixels the highlight will end from the right of the menu item. Postive values end the highlight further to the right than the menu item. Negative values make the highlight end to the left of the right side of the menu item. The value of 0 makes the highlight end at the same right point as the menu item itself.
Parameter name in code: pWFSHorizontalRightOffset
Range: integer
Default: 0

HighlightLocZOffsetText: This has no effect unless Highlight=TRUE. In which case you specify here whether you want the highlight (which is a copy of the "Menu item highlight" vector shape) placed above or below the menu item itself. In other words, what happens when a menu item is highlighted is a copy of the "Menu item highlight" vector image is positioned either above or below the menu item itself. If your menu items have the "background transparent" ink, then you will probably want to specify "below" here. Otherwise, specify "above", or the highlight will not be visible.
Parameter name in code: pWFSHighlightLocZOffsetText
Range: "below", "above"
Default: "below"

CloseMenuOnMouseEvent: Determines whether or how the menu will be closed once the user triggers a specific mouse event. See the documentation on the Menu Verb behavior for more information on this parameter. Specifically, look at the "Close menu on mouse event? " parameter. This is the same parameter.
Parameter name in code: pWFSCloseMenuOnMouseEvent
Range: "no", "mouseEnter", "mouseDown", "mouseUp", "mouseLeave", "rightMouseDown"
Default: "no"

EXAMPLE

theScript=wfsAttachMenuVerb(8, "mouseEnter", "my menu", \
"Do not move it, just open it.", \
0, 0, TRUE, 0, 0, "below", "mouseUp")

The above example attaches the "Menu Verb" behavior to sprite 8. On "mouseEnter" of sprite 8, the "my menu" menu will be opened in the location where it was authored ("Do not move it, just open it."). Since we did not specify "Absolute location." for where we want the menu opened, the next two parameters (0,0) are irrelevant (but must be specified). On mouseenter, the menu will be highlighted (TRUE) and the highlight will be as wide as the menu item itself (0,0). The highlight will appear "below" the menu item. On "mouseUp" of the menu item, the menu will be closed.

THE EASIEST ROUTE

If you want to attach the Menu Verb behavior to a sprite at run-time, use one of the Script Writer handlers to generate the code to do so. If you don't, you have to configure all the above parameters yourself.

Click to go to top of section. wfsAttachCloseMyWindow (theElementSpritenum, CloseMyWindowEvent)

FUNCTION

This attaches the "5: Close My Window" behavior to the theElementSpriteNum. So theElementSpriteNum should be the spritenum of a sprite that is an element of a window. When a sprite has this behavior attached to it, it closes the window it is an element of when CloseMyWindowEvent is triggered. You should not have to call wfsAttachCloseMyWindow if you use the handlers in the Script Writer script.

PARAMETERS

theElementSpriteNum: This is the spritenum of the sprite to which you want the "5: Close My Window" behavior attached. The sprite should be an element of a window.

CloseMyWindowEvent :This is the event you want to close the window.
Parameter name in code: pWFSCloseMyWindowEvent
Range: "mouseEnter", "mouseDown", "mouseUp" and "mouseLeave"
Default: "mouseUp"

RETURN VALUE

Returns 0 if theElementSpriteNum is not an integer or a reference to a sprite. Returns a reference to the script, otherwise. So that if you run

theResult=wfsAttachCloseMyWindow(elementSpriteNum, "mouseUp")

and the attachment was successful (ie, the "5: Close My Window" behavior exists and there is a sprite in channel elementSpriteNum) then theResult.pWFSCloseMyWindowEvent tells you the value of pWFSCloseMyWindowEvent.

EXAMPLE

theScript=wfsAttachCloseMyWindow(7, "mouseUp")

Attaches the "5: Close My Window" behavior to sprite 7. The "5: Close My Window" behavior will close the window sprite 7 is an element of (on mouseUp).

Click to go to top of section. wfsAttachCloseAWindow(theElementSpritenum, CloseAWindowEvent, NameOfWindowToClose)

FUNCTION

wfsAttachCloseAWindow attaches the "Close A Window" behavior to a sprite. The sprite does not have to be an element of a multi-sprite. The "Close A Window" behavior closes the multi-sprite specified by NameOfWindowToClose.

PARAMETERS

theElementSpriteNum: The spritenum of the sprite to which you want the behavior attached.

CloseAWindowEvent: The mouse event you want to trigger the closing of the window.
Parameter name in code: pWFSCloseAWindowEvent
Range: "mouseEnter", "mouseDown", "mouseUp" and "mouseLeave"
Default: "mouseUp"

NameOfWindowToClose: The (string) name of the window you want the sprite to be able to close.
Parameter name in code: pWFSNameOfWindowToClose
Range: name (string) of a multi-sprite or the empty string
Default: the empty string, ie, ""

EXAMPLE

theScript=wfsAttachCloseAWindow(9, "mouseUp", "my window")

Attaches the "Close A Window" behavior to sprite 9. On mouseUp of sprite 9, "my window" will be closed.

RETURN VALUE

Returns 0 if theElementSpriteNum is not an integer or a reference to a sprite. Returns a reference to the script, otherwise. So that if you run

theResult=wfsAttachCloseAWindow(parameters)

and the attachment was successful (ie, the "Close A Window" behavior exists and there is a sprite in channel elementSpriteNum) then theResult.pWFSNameOfWindowToClose tells you the value of pWFSNameOfWindowToClose.

Click to go to top of section. wfsAttachHandle (theElementSpriteNum, ConstrainingWindow, ConstrainLeft, ConstrainTop, ConstrainRight, ConstrainBottom)

FUNCTION

This handler attaches the "6: Handle" behavior to a window element. This behavior allows the user to then drag the whole window around by the handle sprite. You must have a copy of the "6b: Handle" behavior in a cast for this to work. If this behavior is to work properly, there must be a copy of the "4: Window/Menu Element" behavior attached to theElementSpritenum when the user mouses down on the sprite. The parameters allow you to specify a constraining window. The multi-sprite that the "6: Handle" behavior is attached to will have its movement constrained within a rectangle you define by ConstrainLeft, ConstrainTop, ConstrainRight, ConstrainBottom. Positive values are like margins on a page. Negative values enlarge the margins past the constraining window.

PARAMETERS

theElementSpriteNum: The spritenum of the window element to which you want the behavior attached.

ConstrainingWindow: The name of a multi-sprite that will constrain the movement of the multi-sprite the behavior is part of. Specify "" if you want no constraint. You can specify two special values: "stage" or "parent". If you specify "stage" then the multi-sprite will be constrained by the rectangle you define (by the remaining parameters) relative to the stage. Putting in four 0 values, for instance, in the remaining parameters would constrain the multi-sprite to the stage. If you specify "parent" then the multi-sprite will be constrained by its parent, if it has one.
Parameter name in code: pWFSConstrainingWindow
Range: name (string) of a multi-sprite, or the empty string, or "stage" or "parent"
Default: the empty string, ie, ""

ConstrainLeft: An integer. Left margin (relative to constraining window). Positive values are like margins on a page. Negative values enlarge the margins past the constraining window.
Parameter name in code: pWFSConstrainLeft
Range: integer
Default: 0

ConstrainTop: An integer. Top margin (relative to constraining window). Positive values are like margins on a page. Negative values enlarge the margins past the constraining window.
Parameter name in code: pWFSConstrainTop
Range: integer
Default: 0

ConstrainRight: An integer. Right margin (relative to constraining window). Positive values are like margins on a page. Negative values enlarge the margins past the constraining window.
Parameter name in code: pWFSConstrainRight
Range: integer
Default: 0

ConstrainBottom: An integer. Bottom margin (relative to constraining window).Positive values are like margins on a page. Negative values enlarge the margins past the constraining window.
Parameter name in code: pWFSConstrainBottom
Range: integer
Default: 0

EXAMPLES

theScript=wfsAttachHandle(8, "my window", 10, 40, -300, -200)

The above would attach the "6: Handle" behavior to sprite 8. Whatever multi-sprite sprite 8 was an element of would now be draggable aroundable by sprite 8. The multi-sprite would be constrained in its movement relative to a multi-sprite named "my window". The multi-sprite that sprite 8 was an element of could be dragged no further left than 10 pixels to the right of the left border of "my window". And so on concerning the other borders.

theScript=wfsAttachHandle(8, "stage", 0,0,0,0)

The above would constrain the multi-sprite (that sprite 8 is an element of) to the stage.

theScript=wfsAttachHandle(8, "parent", 0,0,0,0)

The above would constrain the multi-sprite that sprite 8 is an element of to moving within the background of its parent (if it has one). If it doesn't have a parent, then there will be no constraint.

RETURN VALUE

Returns 0 if theElementSpriteNum is not an integer or is not a reference to a sprite. Returns a reference to the script, otherwise. So that if you run

theScript=wfsAttachHandle(parameters)

and the attachment was successful (ie, the "6: Handle" behavior exists and there is a sprite in channel elementSpriteNum) then theScript.pWFSConstrainingWindow tells you the value of pWFSConstrainingWindow.

Click to go to top of section. wfsAttachDragElement (theElementSpriteNum, ConstrainToWindow, ConstrainLeft, ConstrainTop, ConstrainRight, ConstrainBottom)

FUNCTION

This handler attaches the "Drag Element" behavior to an element. This behavior allows the user to then drag the element around. You must have a copy of the "Drag Element b" script in a cast for this to work. If this behavior is to work properly, there must be a copy of the "4: Window/Menu Element" behavior attached to theElementSpritenum when the user mouses down on the sprite. That is what makes it an 'element'. The parameters allow you to constrain movement within a rectangle. The sprite that the "Drag Element" behavior is attached to will have its movement constrained within a rectangle you define by ConstrainLeft, ConstrainTop, ConstrainRight, ConstrainBottom. Positive values are like margins on a page. Negative values enlarge the margins past the constraining window, which is the window or menu the element is part of.

PARAMETERS

theElementSpriteNum: The spritenum of the element to which you want the behavior attached.

BringElementToFrontWhenDragging: This boolean determines whether the element is brought to front on mousedown (TRUE) or not (FALSE). Whether the window it's part of is brought to front depends on the configuration of the Window Manager.
Parameter name in code: pWFSBringElementToFrontWhenDragging
Range: boolean
Default: 1

ConstrainToWindow: A boolean that determines whether the motion of theElementSpriteNum will be constrained within a rectangle defined by ConstrainLeft, ConstrainTop, ConstrainRight, and ConstrainBottom. Setting ConstrainToWindow=1 and putting in four 0 values, for instance, in the remaining parameters would constrain the element to moving within the window or menu it is part of.
Parameter name in code: pWFSConstrainToWindow
Range: boolean
Default: 0

ConstrainLeft: An integer. Left margin (relative to constraining window). In this parameter and the remaining three parameters, positive values are like margins on a page. Negative values widen the margins past the boundary of the constraining window. The margins are relative to the background sprite of the window which, by WFS convention, is the sprite below the manager. So, for example, setting ConstrainLeft to 0 would make it so that you couldn't move theElementSpriteNum any further left than the left border of the window theElementSpriteNum is part of. This parameter and the remaining three parameters are meaningless if ConstrainToWindow=0.
Parameter name in code: pWFSConstrainLeft
Range: integer
Default: 0

ConstrainTop An integer. Top margin (relative to constraining window).
Parameter name in code: pWFSConstrainTop
Range: integer
Default: 0

ConstrainRight: An integer. Right margin (relative to constraining window).
Parameter name in code: pWFSConstrainRight
Range: integer
Default: 0

ConstrainBottom: An integer. Bottom margin (relative to constraining window).
Parameter name in code: pWFSConstrainBottom
Range: integer
Default: 0

EXAMPLES

theScript=wfsAttachDragElement(77, TRUE, TRUE, 0,0,0,0)

The above attaches the "Drag Element" behavior to sprite 77. Sprite 77 is therefore draggable. The second parameter being TRUE brings the sprite to front on mousedown. Since the third parameter is set to TRUE, sprite 77 will be constrained in its movement within the rectangle defined by the last four parameters (relative to the window sprite 77 is an element of). Since the last four parameters are 0,0,0,0, sprite 77 will be constrained to move within the window or menu that sprite 77 is an element of.

theScript=wfsAttachDragElement(77, TRUE, FALSE, 0,0,0,0)

The above attaches the "Drag Element" behavior to sprite 77. Sprite 77 is therefore draggable. Since the third parameter is set to FALSE, sprite 77 will not be constrained in its movement at all. And, consequently, the last four parameters are without significance; they could be anything, even unspecified.

theScript=wfsAttachDragElement(77, TRUE, TRUE, 0,0,0,-100)

Same as the first example except the last parameter is -100. This means that sprite 77 will be draggable down 100 pixels from the bottom of the window or menu sprite 77 is an element of. Negative values increase the margins beyond the bounding window. But you still won't be able to move sprite 77 up, left, or right further than the bounding window since the first three parameters are 0,0,0.

RETURN VALUE

Returns 0 if theElementSpriteNum is not an integer or is not a reference to a sprite. Returns a reference to the script, otherwise. So that if you run

theScript=wfsAttachDragElement(parameters)

and the attachment was successful (ie, the "Drag Element" behavior exists and there is a sprite in channel elementSpriteNum) then theScript.pWFSConstrainToWindow tells you the value of pWFSConstrainToWindow, etc.

Click to go to top of section. wfsAttachOpenAWindow (theElementSpriteNum, OpenAWindowEvent, NameOfManagerToOpen, OpeningLocation, AbsoluteLocH, AbsoluteLocV)

FUNCTION

You call wfsAttachOpenAWindow to dynamically attach the '7: Open a Window' behavior to a sprite. The sprite does not have to be an element of a multi-sprite.

PARAMETERS

theElementSpriteNum: The spritenum of the sprite to which you want the behavior attached.

OpenAWindowEvent: The mouse event that opens the window.
Parameter name in code: pWFSOpenAWindowEvent
Range: "mouseEnter", "mouseDown", "mouseUp", "mouseLeave", "rightMouseDown"
Default: "mouseUp"

NameOfManagerToOpen: The name (string) of the multi-sprite you want to open.
Parameter name in code: pWFSNameOfManagerToOpen
Range: name (string) of a manager or "Type the name here"
Default: "Type the name here"

OpeningLocation: This let's you specify where the window is opened.
Parameter name in code: pWFSOpeningLocation
Range: "Do not move it, just open it.", "Center it.", "Open it where mouse is.", "Open at absolute location."
Default: "Do not move it, just open it."

AbsoluteLocH If OpeningLocation="Open at absolute location." then AbsoluteLocH is the x component of the point where the window is opened. This parameter is only used if OpeningLocation="Open at absolute location."
Parameter name in code: pWFSAbsoluteLocH
Range: #min: 0, #max: (the stageRight - the stageLeft)
Default: 0

AbsoluteLocV: If OpeningLocation="Open at absolute location." then AbsoluteLocV is the y component of the point where the window is opened. This parameter is only used if OpeningLocation="Open at absolute location."
Parameter name in code: pWFSAbsoluteLocV
Range: #min: 0, #max: (the stageBottom - the stageTop)
Default: 0

EXAMPLES

theScript=wfsAttachOpenAWindow(9, "mouseUp", "ae", "Center it.", 0,0)

The above attaches the '7: Open a Window' behavior to sprite 9. On mouseup of sprite 9, the multi-sprite named "ae" will be opened. "ae" will be centered on the stage. The last two parameters are irrelevant since we did not make the fourth parameter "Open at absolute location."

theScript=wfsAttachOpenAWindow(9, "rightMouseDown", \
"ae", "Open it where mouse is.", 0,0)

The above attaches the '7: Open a Window' behavior to sprite 9. On rightMouseDown (Ctrl+click on Macs) of sprite 9, the multi-sprite named "ae" will be opened. The top left corner of "ae" will be where the mouse is. The last two parameters are irrelevant since we did not make the fourth parameter "Open at absolute location." Since we are using rightMouseDown, you need to uncheck File>Publish Settings>Shockwave Save>Display Context Menu in Shockwave or the Shockwave right-click popup menu will be displayed.

Click to go to top of section. wfsAttachCursorControl(theElementSpritenum, TypicalSettings, MouseEnterCursorNum, MouseDownCursorNum, MouseUpCursorNum, MouseLeaveCursorNum, MouseUpOutsideCursorNum)

FUNCTION

This handler attaches a copy of the "Cursor Control" behavior to a sprite. The "Cursor Control" behavior makes the cursor be the specified Director system cursor on mouse events.

PARAMETERS

theElementSpriteNum: is the spritenum of the sprite to which you want to attach this behavior.

TypicalSettings: If TypicalSettings="Clickable" then the cursor will behave like the sprite is clickable. If TypicalSettings="Drag and Drop" then the cursor will behave like the sprite is draggable.
Parameter name in code: pWFSTypicalSettings
Range: "Use below settings", "Clickable", "Drag and Drop"
Default: "Use below settings"

mouseEnterCursorNum: This is consequential only if you have specified TypicalSettings="Use below settings". mouseEnterCursorNum is the integer that corresponds with the cursor image you want on mouseEnter of the sprite to which the Cursor Control behavior is attached.
Parameter name in code: pWFSMouseEnterDescription
Range: Consult the macromedia documentation for cursor numbers.
Default: 280 (finger)

MouseDownCursorNum: Same thing as with mouseEnterCursorNum only concerning mouseDown.
Parameter name in code: pWFSMouseDownDescription
Range: Consult the macromedia documentation for cursor numbers.
Default: 280 (finger)

MouseUpCursorNum: Same thing as with mouseEnterCursorNum only concerning mouseUp.
Parameter name in code
: pWFSMouseUpDescription
Range: Consult the macromedia documentation for cursor numbers.
Default: 280 (finger)

MouseLeaveCursorNum: Same thing as with mouseEnterCursorNum only concerning mouseLeave.
Parameter name in code: pWFSMouseLeaveDescription
Range: Consult the macromedia documentation for cursor numbers.
Default: -1 (Standard System Arrow)

MouseUpOutsideCursorNum: Same thing as with mouseEnterCursorNum only concerning mouseUpOutside.
Parameter name in code
: pWFSMouseUpOutsideDescription
Range: Consult the macromedia documentation for cursor numbers.
Default: -1 (Standard System Arrow)

EXAMPLES

theScript=wfsAttachCursorControl(8, "Clickable")

The above attaches the "Cursor Control" behavior to sprite 8 and configures it so that the cursor changes to indicate sprite 8 is clickable.

theScript=wfsAttachCursorControl(8, "Drag and Drop")

The above attaches the "Cursor Control" behavior to sprite 8 and configures it so that the cursor changes to indicate sprite 8 is drag and droppable.

theScript=wfsAttachCursorControl(8, "Use below settings", 302, 302, 302, -1, -1)

The above attaches the Cursor Control behavior to sprite 8. On mouseEnter, mouseDown, and mouseUp, the cursor is a magnifying glass. On mouseLeave and mouseUpOutside, it reverts to the standard system cursor.

Click to go to top of section. wfsAttachRollover (theElementSpriteNum, NameOfWindowToOpenAndClose)

FUNCTION

This handler attaches the "Rollover" behavior to a sprite.

PARAMETERS

theElementSpriteNum: The spritenum of the sprite to which you want the "Rollover" behavior attached.

NameOfWindowToOpenAndClose: This is the (string) name of the window you want opened.
Parameter name in code: pWFSNameOfWindowToOpenAndClose
Range: the name (string) of a multi-sprite
Default: "Type the name here"

EXAMPLES

theScript=wfsAttachRollover(4, "my window")

The above attaches the "Rollover" behavior to sprite 4. When the mouse enters sprite 4, the window named "my window" is opened. When the mouse leaves sprite 4, "my window" is closed.

 

Click to go to the home pageDynamism Attachers