Adding flash content to dreamweaver, A simple flash dialog box example – Adobe Extending Dreamweaver CS4 User Manual
Page 97
91
EXTENDING DREAMWEAVER CS4
User interfaces for extensions
In this example, the user changes the value of the text box and then tabs or clicks elsewhere. Then, 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 hexadecimal 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 “
on page 104 for more information about building objects, and “
” on page 131 for information about
commands) using the
form
tag with the
object
tag to embed your Flash content in a Dreamweaver dialog box.
A simple Flash dialog box example
In this example, you use Dreamweaver to create a command. The command created displays a SWF file called
myFlash.swf when the user clicks the command in the Commands menu. For specific information about creating
commands before trying this example, see “
Note: This example assumes that you already have a SWF file called myFlash.swf in the Configuration/Commands folder
of your Dreamweaver application installation folder. To test it with your own SWF file, save the SWF file to the
application Commands folder, and substitute your filename in all instances of myFlash.swf.
In Dreamweaver, open a new basic HTML file (this file is your Command definition file). Between the opening and
closing
title
tags, enter My Flash Movie, so that the head of your page reads as follows:
Now, save the file as My Flash Movie.htm in the application Configuration/Commands folder (but do not close the file
yet). Save the file now, so that you can embed your SWF file with a relative path; otherwise Dreamweaver uses an
absolute path.
Back in the HTML document, between the opening and closing
body
tags, add an opening and closing
form
tag. Then,
within the
form
tags, use the Insert > Media > Flash option to add your SWF file to the Command definition file. When
prompted, select the SWF file in the Commands folder, and click OK. Your Command definition file now looks like
the following example (the
width
and
height
attributes could differ, depending on your SWF file properties):