Including Dynamic Parameters for Flash

You can include dynamic parameters for any Flash objects or other media objects (ActiveX objects, plug-ins, Java applets, and Macromedia Shockwave objects) that are inserted in your pages.

When you insert a media file in a Web page, you can include attributes for several parameters, such as the size and alignment of the display, the image quality, and looping specifications. You can make these parameters dynamic by binding the HTML attribute values for the parameters to a database-field value. You need to have appropriate data in the database field for the attribute you want to bind. You may need to add a new field or table to your database for this purpose.

To add a dynamic Flash parameter:


Open a new ASP page in Dreamweaver by choosing File > New > Dynamic page > ASP. Save it as flashObj.asp.


Choose Insert > Media > Flash. The Select File dialog appears.


Browse to the location of the cafe_townsend folder, and then select flash_fma.swf, a Flash movie file. Click OK to close the dialog and insert the Flash object on your page (Figure 7.28).

Figure 7.28. After you insert a Flash object, a placeholder for a Flash file appears in Design view.


In the Application panel group, click the Bindings tab to access the Bindings panel.


Click the plus button and select Recordset (Query) from the menu. The Recordset dialog appears.


In the Name field, enter flashObject, and from the Connection drop-down list select the name of the ASP database connection you created in the "To connect to a database using ASP" task in Chapter 4 (Figure 7.29). (We named ours connASPTest.) If you haven't already created an ASP database connection, see the instructions in Chapter 4.

Figure 7.29. The flashObject recordset includes the NAME and FL_QUALITY fields from the REGION table in the connASPTest database connection.


From the Table drop-down list, select REGION. In the Columns section, choose the Selected radio button and then choose the NAME and FL_QUALITY fields.

The NAME field contains the name of the geographic region. We added an FL_QUALITY field and data to the Region table to provide a quality parameter for the rendering of the Flash movie in a browser based on the processor speed of the user's connection speed.


Click OK to save the recordset and close the Recordset dialog.

The flashObject recordset appears in the recordset list on the Bindings panel (Figure 7.30).

Figure 7.30. The recordset name (flashObject) appears on the Bindings panel after the recordset is defined.


Open the Property inspector by choosing Window > Properties from the main menu bar. Click the arrow button in the lower-right corner to expand the Property inspector (Figure 7.31).

Figure 7.31. The fully expanded Property inspector.


Click the Parameters button to open the Parameters dialog. Click the plus button and enter quality for the name of the parameter. Click below the Value column, and then click the lightning bolt button when the value field displays (Figure 7.32).

Figure 7.32. Click the lightning bolt button in the Parameters dialog to open the Dynamic Data dialog.

The Dynamic Data dialog appears (Figure 7.33).

Figure 7.33. You can use the Dynamic Data dialog to choose a recordset field and add a dynamic attribute value for a parameter in a media object, such as a Flash movie.


Select the FL_QUALITY field and click OK to close the Dynamic Data dialog.


Click OK to close the Parameters dialog. The Flash quality parameter (FL_QUALITY) will be added to the Flash movie object when the flashObject.asp page is requested by a browser.


  • Click the Test button in the Recordset dialog to view the data in the recordset (Figure 7.34).

    Figure 7.34. Viewing the data in the flashObject recordset in the Test SQL Statement dialog.

Macromedia Dreamweaver 8 Advanced for Windows and Macintosh. Visual Quickpro Guide
Macromedia Dreamweaver 8 Advanced for Windows and Macintosh: Visual QuickPro Guide
ISBN: 0321384024
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Lucinda Dykes © 2008-2017.
If you may any questions please contact us: