User Guide
Adding Flash content to Dreamweaver 63
//add the new node to the top of the selected node’s children
selNode.innerHTML = '<mm:treenode name="item10" value="New item11" ¬ expanded
selected>' + selNode.innerHTML;
Deleting nodes
To delete the currently selected node from the document structure, use the
innerHTML or outerHTML properties.
The following example deletes the entire selected node and any children:
var tree = document.myTreeControl;
var selNode = tree.selectedNodes[0];
selNode.outerHTML = "";
A color button control for extensions
In addition to the standard input types such as text, checkbox, and button, Dreamweaver
supports
mmcolorbutton, an additional input type in extensions.
Specifying
<input type="mmcolorbutton"> in your code causes a color picker to appear in the
UI. You can set the default color for the color picker by setting a value attribute on the input tag.
If you do not set a value, the color picker appears grey by default and the value property of the
input object returns an empty string.
The following example shows a valid
mmcolorbutton tag:
<input type="mmcolorbutton" name="colorbutton" value="#FF0000">
<input type="mmcolorbutton" name="colorbutton" value="teal">
A color button has one event, onChange, which is triggered when the color changes.
You might want to keep a text box and a color picker synchronized. The following example
creates a text box that synchronizes the color of the text box with the color of the color picker:
<input type = "mmcolorbutton" name="fgcolorPicker"
onChange="document.fgcolorText.value=this.value">
<input type = "test" name="fgcolorText"
onBlur="document.fgColorPicker.value=this.value">
In this example, when the user changes the value of the text box and then tabs or clicks
elsewhere, the color picker updates to show the color that is specified in the text box. Whenever
the user selects a new color with the color picker, the text box updates to show the hex value for
that color.
Adding Flash content to Dreamweaver
Flash content (SWF files) can display in the Dreamweaver interface either as part of an object or
command. This Flash support is especially useful if you build extensions that use Flash forms,
animations, ActionScript or other Flash content.
Basically, you leverage the ability for Dreamweaver objects and commands to display dialogs
(see Chapter 6, “Insert Bar Objects,” on page 113 for more information about building objects
and Chapter 7, “Commands,” on page 135 for information about commands) using the
form tag
with the
object tag to embed your Flash content in a Dreamweaver dialog box.