[ Team LiB ] |
![]() ![]() |
Recipe 17.3 Automatically Creating HTML Template for Including Flash FilesProblemYou want to automatically generate the required HTML for embedding a Flash file in a web component. SolutionFrom within Macromedia Flash 6, use the "File
DiscussionWith an .swf file open in Macromedia Flash 6, use
the "File Example 17-5. Automatically generated template text from within the Flash application<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>example</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!--DeductionsPaycheckSDIAnnual SalaryMedicareSocial
securityESPP401k$#%FederalStateMarriedSingleactions-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=
"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.
cab#version=6,0,0,0"WIDTH="550" HEIGHT="400" id="example" ALIGN=""
>
<PARAM NAME=movie VALUE="example.swf">
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="example.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT=
"400" NAME="example" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE=
"http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
</BODY>
</HTML>
Your JSP probably already includes the boilerplate HTML such as the body tag; therefore, you only have to cut and paste the noncommented, emphasized code in Example 17-5.
Example 17-6 in the next recipe shows a JSP file with the same type of Flash-related object and embed tags as those illustrated in this recipe. Figure 17-3 shows the automatically generated HTML file from Example 17-5. Figure 17-3. HTML template text with an embedded Flash file![]()
See AlsoMacromedia technical notes page: http://www.macromedia.com/support/flash/technotes.html; an article about alternative techniques to using the embed tag: http://www.macromedia.com/devnet/mx/dreamweaver/articles/flash_satay.html. |
[ Team LiB ] |
![]() ![]() |