MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual page 241

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

The
argument type specifies that the argument is both a navigational URL and a
URL
dependent URL or that it is a URL of an unknown type and should appear in the site map and
be considered a dependent file when downloading from or uploading to a server.
The
argument type specifies that the argument is a Netscape Navigator 4.0-style
NS4.0ref
object reference.
The
argument type specifies that the argument is an Internet Explorer DOM 4.0-
IE4.0ref
style object reference.
The
argument type specifies that the argument is a simple object name, as specified in
objName
the
attribute for the object. This type was added in Dreamweaver 3.
NAME
The
argument type specifies that the argument is none of the above types.
other
Example
This simple example of the
Browser Window behavior action, which returns a function that always has three arguments (the
URL to open, the name of the new window, and the list of window properties):
function identifyBehaviorArguments(fnCallStr) {
return "URL,other,other";
}
A more complex version of the
behavior functions that have a variable number of arguments (such as Show/Hide Layer). For this
example version of the
of arguments, and additional arguments always come in multiples of the minimum number. In
other words, a function with a minimum number of arguments of 4 may have 4, 8, or 12
arguments, but it cannot have 10 arguments:
function identifyBehaviorArguments(fnCallStr) {
var listOfArgTypes;
var itemArray = dreamweaver.getTokens(fnCallStr, '(),');
// The array of items returned by getTokens() includes the
// function name, so the number of *arguments* in the array
// is the length of the array minus one. Divide by 4 to get the
// number of groups of arguments.
var numArgGroups = ((itemArray.length - 1)/4);
// For each group of arguments
for (i=0; i < numArgGroups; i++){
// Add a comma and "NS4.0ref,IE4.0ref,other,dep" (because this
// hypothetical behavior function has a minimum of four
// arguments the Netscape object reference, the IE object
// reference, a dependent URL, and perhaps a property value
// such as "show" or "hide") to the existing list of argument
// types, or if no list yet exists, add only
// "NS4.0ref,IE4.0ref,other,dep"
var listOfArgTypes += ((listOfArgTypes)?",":"") + ¬
"NS4.0ref,IE4.0ref,other,dep";
}
}
identifyBehaviorArguments()
identifyBehaviorArguments()
identifyBehaviorArguments()
function works for the Open
function is necessary for
function, there is a minimum number
The Behaviors API
241

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents