The Flash Objects Api - Adobe 38040334 - Dreamweaver CS3 User Manual

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

DREAMWEAVER CS3
42
API Reference
file that is already installed in the Configuration/Objects/FlashElements folder or one of its subfolders to the
Insert bar or Insert menu). Extension developers can use the JavaScript function
"dom.insertFlashElement()" on
page 127
in the object definition file to add available Flash elements to a document. When the user selects the Flash
element object, Dreamweaver unpacks the SWC file, which contains Flash content (SWF file) and a file that details
the parameters the user can edit. Dreamweaver then inserts the SWF file into the user's document.
Adding a Flash element to the Insert Bar
As with other objects, you add a Flash element to the Insert Bar using the
tag. However, a
tag for a
button
button
Flash element must have both
and
attributes to add the element successfully to the document (see the
file
command
button tag details in "Insert Bar Objects" in Extending Dreamweaver). Use the
attribute to tell Dreamweaver
file
where the source file for the element resides relative to the Objects folder. Then, use the
attribute to tell
command
Dreamweaver to use the
function when the user clicks the button on the Insert bar.
dom.insertFlashElement()
The following example shows the code to place in the inserbar.xml file (either as a child of the appropriate
category
or
tag, depending on where you want the Flash element button to appear):
menubutton
_
<button id="FlashElement
Nav"
name="Navigation"
file="FlashElements\nav.swc"
command="dw.getDocumentDOM().insertFlashElement('nav.swc')" />
Note: The image on the Insert bar for the Flash element is determined within the SWC file. Also, the
tag for a
button
Flash element object must have a file attribute defined.
Adding a Flash Element to a menu
A Flash element can also reside on the Insert menu, or on other menus, in Dreamweaver. Use the JavaScript function
"dom.insertFlashElement()" on page 127
with the menus.xml file format (see "Menus and Menu Commands" in
Extending Dreamweaver) to specify the Flash element menu item location. The following example shows how code
within the menus.xml file makes a Navigation Flash element available on the Insert > Flash Element menu:
<menuitem name="Navigation"
key=""command="dw.getDocumentDOM().insertFlashElement('nav.swc')"
enabled="(dw.getFocus() != 'browser') && (dw.getDocumentDOM() != null && ¬
dw.getDocumentDOM().getParseMode() == 'html')"
id="DWMenu_Insert_FlashElement_Nav" />

The Flash Objects API

The Flash Objects API lets extension developers build objects that create simple Flash content through Flash
Generator. This API provides a way to set parameters in a Flash Generator template and output a SWF or image file.
The API lets you create new Flash objects as well as read and manipulate existing Flash objects. The Flash button and
Flash text features are built using this API.
The SWT file is a Flash Generator Template file, which contains all the information you need to construct a Flash
Object file. These API functions let you create a new SWF file (or image file) from a SWT file by replacing the param-
eters of the SWT file with real values. For more information on Flash, see the Flash documentation. The following
functions are methods of the
object.
SWFFile

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents