In this
example, two exist: theTarget and theValue. Ideally, your action should be flexible enough to enable
any argument to be user-defined. Here, two attributes, at most, are taken in through your parameter form
and passed to the function.
After you??™ve created and tested your function in Dreamweaver, save it. I??™ve found it helpful to go back to the
original file as I build my action and verify that I have everything in working order.
To look at the Set Layer Z Index behavior code in full, check out the Chapter 34 Examples
folder on the DVD that accompanies this book. If you??™d like to install the Set Layer Z Index
behavior, use the Extension Manager (Help ??? Manage Extensions) to install the behavior from the DVD??™s
Additional Extensions folder.
ON the DVD-ROM ON the DVD-ROM
BC 27
Creating a Behavior
Step 2: Create the action file
In the next phase of behavior creation, you build the skeleton of the action file and begin filling in the necessary
JavaScript functions. Each action file must have, at a minimum, the following four functions:
n canAcceptBehavior()??”Determines if the behavior should be available. If it is not available,
the entry in the Add Action (+) drop-down list is not selectable.
n behaviorFunction()??”Inserts the general function in the section of the Web page.
Pages:
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902