Read this article to learn how to add Flash content to Dreamweaver.
Flash content (SWF files) can display in the Dreamweaver interface either as part of an object or command. Flash support is especially useful if you build extensions that use Flash forms, animations, ActionScript or other Flash content.
Basically, you enable Dreamweaver objects and commands to display dialogs using the form tag with the object tag to embed your Flash content in a Dreamweaver dialog box.
See Insert bar objects for more information about building objects, and Commands for information about commands.
A simple Flash dialog box example
The following information is an example that provides information on using 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 Commands.
This example assumes that you already have a SWF file called myFlash.swf in the 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:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My Flash Movie</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head>
Now, save the file as My Flash Movie.htm in the application Commands folder. 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.
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 > HTML > Flash SWF 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):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My Flash Movie</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <body> <form> <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700" height="150"> <param name="movie" value="myFlash.swf"> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="myFlash.swf" width="700" height="150"> <!--<![endif]--> <param name="quality" value="high"/> <param name="wmode" value="opaque" /> <param name="swfversion" value="8.0.35.0" /> <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --> <param name="expressinstall" value="../../../../../ColdFusion8/wwwroot/lr/Scripts/expressInstall.swf" /> <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> <div> <h4>Content on this page requires a newer version of Adobe Flash Player.</h4> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p> </div> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </form> </body> </html>
Save the file again. Exit, and restart Dreamweaver. Select the Tools > Command > My Flash Movie option. Your SWF file appears in a Dreamweaver dialog box.
This example shows a simple implementation of the SWF file support of Dreamweaver. After you are familiar with building objects and commands as well as more sophisticated forms, you can integrate SWF files into your Dreamweaver extensions. The integration provides for a more dynamic user experience.
For more information about writing a commandButtons() function to add buttons to the dialog box that displays your SWF files, see Commands.