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 Insert bar objects for more information about building objects, and Commands 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 Commands.

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:

 <!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 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):

<!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. Next, exit, and restart Dreamweaver. Select the Command > My Flash Movie option, and your SWF file appears in a Dreamweaver dialog box, as shown in the following figure:

Select the My Flash Movie option
Select the My Flash Movie option

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, see Commands about writing a commandButtons() function to add buttons to the dialog box that displays your SWF files.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy