BC 52
Creating a Behavior
For this property to work correctly, a new function must be included in the behavior. The function,
identifyBehaviorArguments(), passes the argument structure to Dreamweaver so it can update the
URLs, if necessary. The function also identifies the AP element objects in the behavior that Dreamweaver
must correct if the Convert Layers to Tables command is used.
The identifyBehaviorArguments() function accepts a string that contains the behavior function call,
with arguments. The function then extracts the arguments into an array and identifies which arguments in
the array are URLs, which ones are AP element objects, and which ones are neither. There are four main
return values:
n URL: When the argument is a file or file path
n NS4.0ref: When the argument identifies an AP element in Netscape syntax, such as document.
layers[\??™Layer1\??™]
n IE4.0ref: When the argument identifies an AP element in Internet Explorer syntax, such as document.
all[\??™Layer1\??™]
n other: When the argument is none of the preceding
You can see an example of the identifyBehaviorArguments() function in the Check Plugin action:
function identifyBehaviorArguments(fnCallStr) {
var argArray;
argArray = extractArgs(fnCallStr);
if (argArray.length == 5) {
return ???other,URL,URL,other???;
}
else {
return ??????;
}
}
As with the inspectBehavior() function, the array for the function call string is one element longer
than the number of arguments??”the initial array element is the function name itself.
Pages:
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946