Use the
built-in JavaScript escape() function to convert space and special characters in the URL to UNIX-friendly
strings. The companion unescape() function reverses the process and is used in the
inspectBehavior() function.
To build your applyBehavior() function, follow these steps:
1. Declare the necessary variables inside the function:
var layersArray, layerIndex;
var argString = ??????;
2. Get an array of AP elements from the document:
layersArray = getAllObjectRefs(???NS 4.0???,???LAYER???);
3. Put the index of the AP element selected in the drop-down list into a variable:
layerIndex = findObject(???LAYER_LIST???).selectedIndex;
4. The next two lines put the chosen parameters (the AP element name and the z-index value) into
an argument string, one after another, separated by a comma:
argString += ????????? + getNameFromRef(layersArray[layerIndex]) + ??????,???;
argString += ????????? + findObject(???Z-INDEX???).value + ?????????;
5. Return the runtime function call, incorporating the variables. The applyBehavior() function
must return a complete string. Enclose the argument variables within single quotes. If you use any
internal quotes, they should be preceded by (escaped with) a backslash, as in: \??? or \??™.
return ???tmt_DivIndex(??? + argString + ???)???;
In the actual behavior, it??™s a good idea to add error checking to prevent the user from entering something
other than an integer in the z-index field.
Pages:
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911