Insert object functions

 < Day Day Up > 

Insert object functions handle operations related to the objects on the Insert bar or listed on the Insert menu.

dom.insertFlashElement()

Availability

Dreamweaver MX 2004.

Description

Inserts a specified Flash element (SWC file) into the current document. This function assumes that the Flash element has been added to the Insert bar, and the component file resides in the Configuration/Objects/FlashElements folder or subfolder.

Arguments

 swcFilename 

  • The swcFilename string is the path and name of the desired flash component relative to the Configuration/Objects/FlashElements folder.

Returns

Nothing.

Example

The following example inserts the navigation bar Flash component, which resides in the Components/Objects/FlashElements/Navigation folder, into the current document:

 dom.insertFlashElement("\Navigation\navBar.swc"); 

dreamweaver.objectPalette.getMenuDefault()

Availability

Dreamweaver MX 2004.

Description

Retrieves the ID string of the default item for the associated menu.

Arguments

 menuId 

  • The menuId argument is the string that defines the menu in the insertbar.xml file.

Returns

A string value defining the ID of the default item.

Example

The following example assigns the current default object for the Media menu to the defID variable:

 var defId = dw.objectPalette.getMenuDefault("DW_Media"); 

dreamweaver.objectPalette.setMenuDefault()

Availability

Dreamweaver MX 2004.

Description

Sets the default object for a pop-up menu. The default object's icon represents the specified pop-up menu on the Insert bar. The user can click on the default object to insert it, or click on the arrow beside the default object to open the pop-up menu and see the other objects in that menu. Dreamweaver sets the new menu default the next time the user opens Dreamweaver or uses the Reload Extensions command.

Arguments

 menuId, defaultId 

  • The menuId argument is the string that defines the menu in the insertbar.xml file.

  • The defaultId argument is the string that defines the new default object in the insertbar.xml field.

Returns

A Boolean value: true if the new default is successfully set; false otherwise.

Example

The following example sets the Flash object as the default object for the Media menu:

 dw.objectPalette.setMenuDefault("DW_Media", "DW_Flash"); 

dreamweaver.reloadObjects()

Availability

Dreamweaver MX 2004.

Description

Reloads all the objects on the Insert bar. This function is the equivalent of Control+left-clicking the mouse on the Categories menu on the Insert bar and selecting the Reload Extensions menu option.

Arguments

None.

Returns

A Boolean value: TRue if the objects were successfully loaded; false otherwise.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net