To check for AP elements, use this code:
function canAcceptBehavior() {
var nameArray = getObjectRefs(???NS 4.0???,???document???,???LAYER???);
return (nameArray.length > 0);
}
Here, if the Dreamweaver function getObjectRefs() finds any AP element objects, the nameArray
length is greater than zero, and the canAcceptBehavior function returns True; otherwise, False is
returned, and the behavior name in the Add Action (+) list of the Behaviors panel is dimmed and inactive.
Step 3: Build the user interface
The user interface of a behavior is a parameter form, constructed with HTML form elements. The number
and type of arguments required by your completed function are the key indicators of what to include in
your action??™s parameter.
In the Set Layer Z Index example, the function requires two primary arguments: theTarget and
theValue. The interface must enable the user to choose the target parameter??”the AP element being
affected??”and the value of the Z index. To be useful, the action should list all available AP elements by
name.
Dreamweaver recommends using a specific DOCTYPE statement for different types of
extension user interfaces (UIs). For example, when creating a dialog box, you should use:
Pages:
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906