SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1901 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"

Sounds simple, but consider that an object (such as a form text field or AP element) can be
ON the DVD-ROM ON the DVD-ROM
TIP TIP
BC 32
Creating a Behavior
almost anywhere in the realm of the document DOM. A search can be a daunting prospect without this
invaluable function. Here, findObject() is initially used to get the Layer_List object, the drop-down
list in the dialog box, which is populated programatically. After the string arguments are in an array, they
can be extracted and placed back in the parameter form.
To write the inspectBehavior() function, follow these steps:
1. Declare several basic variables: argArray, layerMenu, layersArray, menuLength, and
found.
var argArray,layerMenu,layersArray,menuLength,found;
2. Use the extractArgs() function to separate the arguments passed in msgStr and set them
equal to a variable, argArray:
argArray = extractArgs(msgStr);
3. Get the drop-down menu object by using findObject():
layerMenu = findObject(???LAYER_LIST???);
4. Examine the user??™s document, find all the AP elements, and put them in an array:
layersArray = getAllObjectRefs(???NS 4.0???,???LAYER???);
5. Now you??™re ready to loop through all the AP elements on the page and look for the name of the
one passed in the argument. After you find that AP element, select it, and its z-index is displayed
in the other field of the dialog box (if the z-index was passed in with the arguments).


Pages:
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913