|
|
Specify publish settings for HTML documents
Playing Flash content
in a web browser requires an HTML document that activates the SWF
file and specifies browser settings. The Publish command automatically
generates this document from HTML parameters in a template document.
The
template document can be any text file that contains the appropriate template
variables—including a plain HTML file, a file that includes code
for special interpreters such as ColdFusion® or
Active Server Pages (ASP), or a template included with Flash.
To manually enter HTML
parameters for Flash or customize a
built‑in template, use an HTML editor.
HTML parameters determine
where the content appears in the window, the background color, the
size of the SWF file, and so on, and set attributes for the object and embed tags.
Change these and other settings in the HTML panel of the Publish
Settings dialog box. Changing these settings overrides options you’ve
set in the SWF file.
Specify the settings- Select File > Publish Settings
and click Formats. The HTML file type is selected by default.
- Use the default filename, which matches the name of
your document, or enter a unique name, including the .html extension.
- To show HTML settings and select an installed template
to use, from the Template pop‑up menu, click HTML. To show a description
of the selected template, click Info. The default selection is Flash
Only.
- If you selected an HTML template other than Image Map
or QuickTime, and on the Flash tab you set the Version to Flash
Player 4 or later, select Flash Version Detection.
Note: Flash Version Detection configures your document to
detect the version of Flash Player that the user has and sends the
user to an alternative HTML page if the user does not have the targeted
player.
- Select
a Dimensions option to set the values of the width and height attributes
in the object and embed tags:
- Match Movie
- (Default) Uses the size of the SWF file.
- Pixels
- Enters the number of pixels for the width and height.
- Percent
- Specifies the percentage of the browser window that the
SWF file occupies.
- To
control the SWF file’s playback and features, select Playback options:
- Paused At Start
- Pauses the SWF file until a user clicks a button or selects
Play from the shortcut menu. (Default) The option is deselected
and the content begins to play as soon as it is loaded (the PLAY parameter
is set to true).
- Loop
- Repeats the content when it reaches the last frame. Deselect
this option to stop the content when it reaches the last frame.
(Default) The LOOP parameter is on.
- Display Menu
- Shows
a shortcut menu when users right-click (Windows) or Control-click
(Macintosh) the SWF file. To show only About Flash in the shortcut menu,
deselect this option. By default, this option is selected (the MENU parameter
is set to true).
- Device Font
- (Windows
only) Substitutes anti-aliased (smooth-edged) system fonts for fonts
not installed on the user’s system. Using device fonts increases
the legibility of type at small sizes and can decrease the SWF file’s
size. This option affects only SWF files that contain static text
(text that you create when authoring a SWF file and that does not
change when the content appears) set to display with device fonts.
- To
determine the trade-off between processing time and appearance,
as described in the following list, select Quality options. These
options set the QUALITY parameter’s value in the object and embed tags.
- Low
- Favors playback speed over appearance and does not use
anti-aliasing.
- Auto Low
- Emphasizes speed at first but improves appearance whenever possible.
Playback begins with anti-aliasing turned off. If Flash Player detects
that the processor can handle it, anti-aliasing is automatically
turned on.
- Auto High
- Emphasizes playback speed and appearance equally at first
but sacrifices appearance for playback speed if necessary. Playback
begins with anti-aliasing turned on. If the actual frame rate drops
below the specified frame rate, anti-aliasing is turned off to improve
playback speed. To emulate the View > Antialias setting,
use this setting.
- Medium
- Applies some anti-aliasing but does not smooth bitmaps.
Medium produces a better quality than the Low setting but lower
quality than the High setting.
- High
- (Default) Favors appearance over playback speed and always
uses anti-aliasing. If the SWF file does not contain animation,
bitmaps are smoothed; if the SWF file contains animation, bitmaps
are not smoothed.
- Best
- Provides the best display quality and does not consider
playback speed. All output is anti-aliased and bitmaps are always
smoothed.
- Select a Window Mode option, which controls the HTML wmode attribute
in the object and embed tags.
The window mode modifies the relationship of the content bounding
box or virtual window with content in the HTML page as described
in the following list:
- Window
- (Default) Does not embed any window-related attributes
in the object and embed tags.
The background of the content is opaque and uses the HTML background
color. The HTML code cannot render above or below the Flash content.
- Opaque Windowless
- Sets the background of the Flash content
to opaque, obscuring anything under the content. Lets HTML content
appear above or on top of content.
- Transparent Windowless
- Sets the background of the Flash content
to transparent, allowing the HTML content to appear above and below the
content. For browsers that support windowless modes, see Parameters and attributes for object and embed tags.
If you turn
on Hardware Acceleration in the Flash tab of the Publish Settings dialog
box, the Window Mode you select is ignored and defaults to Window.
For
a demonstration of setting the Window Mode, see the TechNote titled How to make a Flash movie with a transparent
background.
Note: In some instances, complex rendering
in Transparent Windowless mode can result in slower animation when
the HTML images are also complex.
- To position the SWF file
window in the browser window, select one of the following HTML Alignment
options:
- Default
- Centers the content in the browser window and crops edges
if the browser window is smaller than the application.
- Left, Right, Top, Or Bottom
- Align SWF files along the corresponding edge of the browser
window and crop the remaining three sides as needed.
- To
place the content within specified boundaries if you’ve changed
the document’s original width and height, select a Scale option.
The Scale option sets the SCALE parameter in the object and embed tags.
- Default (Show All)
- Shows the entire document in the specified area without distortion
while maintaining the original aspect ratio of the SWF files. Borders
can appear on two sides of the application.
- No Border
- Scales the document to fill the specified area and keeps
the SWF file’s original aspect ratio without distortion, cropping
the SWF file if needed.
- Exact Fit
- Shows the entire document in the specified area without
preserving the original aspect ratio, which can cause distortion.
- No Scale
- Prevents the document from scaling when the Flash Player
window is resized.
- To set how the content
is placed within the application window and how it is cropped, select
the Flash Alignment option. This option sets the SALIGN parameter
of the object and embed tags.
- To
show error messages if tag settings conflict—for example, if a template
has code referring to an alternative image that was not specified—select
Show Warning Messages.
- To save the settings with the current file, click OK.
Parameters and attributes for object and embed tagsThe following tag attributes and parameters
describe the HTML code that the Publish command creates. Refer to
this list as you write custom HTML to show Flash content.
Unless noted, all items apply to both the object and embed tags.
Optional entries are noted. Internet Explorer recognizes parameters used
with the object tag; Netscape recognizes the embed tag.
Attributes are used with both the object and embed tags.
When you customize a template, you can substitute a template variable
(identified in the Value section for each parameter in the following
list) for the value.
Note: The attributes and parameters listed
in this section are shown in lowercase to comply with the XHTML
standard.
- devicefont attribute/parameter
- (Optional)
Specifies whether static text objects are rendered in device fonts,
even if the Device Font option is not selected. This attribute applies
when the necessary fonts are available from the operating system.
Value: true | false
Template
variable: $DE
- src attribute
- Specifies the
name of the SWF file to be loaded. Applies to the embed tag
only.
Value: movieName.swf
Template
variable: $MO
- movie parameter
- Specifies
the name of the SWF file to be loaded. Applies to the object tag
only.
Value: movieName.swf
Template
variable: $MO
- classid attribute
- Identifies
the ActiveX control for the browser. The value must be entered exactly
as shown. Applies to the object tag only.
Value: clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
- width attribute
- Specifies
the width of the application either in pixels or as a percentage
of the browser window.
Value: n or n%
Template
variable: $WI
- height attribute
- Specifies
the height of the application either in pixels or as a percentage
of the browser window.
Note: Because Flash applications
are scalable, quality doesn’t degrade at different sizes if the
aspect ratio is maintained. (For example, the following sizes all have
a 4:3 aspect ratio: 640 x 480 pixels, 320 x 240
pixels, and 240 x 180 pixels.)
Value: n or n%
Template
variable: $HE
- codebase attribute
- Identifies
the location of the Flash Player ActiveX control so that the browser
can automatically download it if it is not already installed. The value
must be entered exactly as shown. Applies to the object tag
only.
Value: http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0
- pluginspage attribute
- Identifies
the location of the Flash Player plug‑in so that the user can download
it if it is not already installed. The value must be entered exactly
as shown. Applies to the embed tag only.
Value: http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash
- swliveconnect attribute
- (Optional)
Specifies whether the browser should start Java™ when
loading Flash Player for the first time. The default value is false if this
attribute is omitted. If you use JavaScript and Flash on the same page, Java must be
running for the fscommand() function to work. However,
if you use JavaScript only for browser detection or another purpose
unrelated to fscommand() actions, you can prevent
Java from starting by setting SWLIVECONNECT to false.
To force Java to start when you are not using JavaScript, explicitly
set the SWLIVECONNECT attribute to true.
Starting Java substantially increases the startup time for a SWF
file; set this tag to true only when necessary.
Applies to the embed tag only.
Use the fscommand() action
to start Java from a stand-alone projector file.
Value: true | false
- play attribute/parameter
- (Optional)
Specifies whether the application begins playing immediately on
loading in the web browser. If your Flash application
is interactive, let the user initiate play by clicking a button
or performing another task. In this case, set the play attribute
to false to prevent the application from starting
automatically. The default value is true if this attribute
is omitted.
Value: true | false
Template
variable: $PL
- loop attribute/parameter
- (Optional)
Specifies whether the content repeats indefinitely or stops when
it reaches the last frame. The default value is true if this
attribute is omitted.
Value: true | false
Template
variable: $LO
- quality attribute/parameter
- (Optional)
Specifies the level of anti-aliasing to be used. Because anti-aliasing
requires a faster processor to smooth each frame of the SWF file
before it is rendered on the viewer’s screen, select one of the following
values based on whether your priority is speed or appearance:
- Low
- Favors playback speed over appearance and never uses anti-aliasing.
- Autolow
- Emphasizes speed at first but improves appearance whenever possible.
Playback begins with anti-aliasing turned off. If Flash Player detects
that the processor can handle it, anti-aliasing is turned on. Note:
SWF files authored using ActionScript 3.0 do not recognize the autolow value.
- Autohigh
- Initially emphasizes playback speed and appearance equally,
but sacrifices appearance for playback speed if necessary. Playback
begins with anti-aliasing turned on. If the frame rate drops below
the specified frame rate, anti-aliasing is turned off to improve
playback speed. Use this setting to emulate the Antialias command
(View > Preview Mode > Antialias).
- Medium
- Applies some anti-aliasing and does not smooth bitmaps. It
produces a better quality than the Low setting but a lower quality
than the High setting.
- High
- Favors appearance over playback speed and always applies
anti-aliasing. If the SWF file does not contain animation, bitmaps
are smoothed; if the SWF file has animation, bitmaps are not smoothed.
- Best
- Provides the best display quality and does not consider playback
speed. All output is anti‑aliased, and all bitmaps are smoothed.
The
default value for quality is high if
this attribute is omitted.
Value: low | medium | high | autolow | autohigh | best
Template
variable: $QU
- bgcolor attribute/parameter
- (Optional)
Specifies the background color of the application. Use this attribute
to override the background color setting that the SWF file specifies.
This attribute does not affect the background color of the HTML
page.
Value: #RRGGBB (hexadecimal
RGB value)
Template variable: $BG
- scale attribute/parameter
- (Optional)
Defines how the application is placed in the browser window when width and height values
are percentages.
- Showall (Default)
- Makes the entire content visible in the specified area without distortion
while maintaining the original aspect ratio of the application.
Borders can appear on two sides of the application.
- Noborder
- Scales the content to fill the specified area, without distortion
but possibly with some cropping, while maintaining the original
aspect ratio of the application.
- Exactfit
- Makes the entire content visible in the specified area without
trying to preserve the original aspect ratio. Distortion can occur.
The
default value is showall if this attribute is omitted
(and width and height values are
percentages).
Value: showall | noborder | exactfit
Template
variable: $SC
- align attribute
- Specifies
the align value for the object, embed,
and img tags and determines how the SWF file is
positioned within the browser window.
- Default
- Centers the application in the browser window and crops edges
if the browser window is smaller than the application.
- L, R, T, and B
- Align the application along the left, right, top, or bottom
edge, respectively, of the browser window and crop the remaining
three sides as needed.
Value: Default | L | R | T | B
Template
variable: $HA
- salign parameter
- (Optional)
Specifies where a scaled SWF file is positioned in the area that
the width and height settings
define.
- L, R, T, And B
- Align the application along the left, right, top, or bottom
edge, respectively, of the browser window and crop the remaining
three sides as needed.
- TL And TR
- Align the application to the top-left and top-right corner,
respectively, of the browser window and crop the bottom and remaining
right or left side as needed.
- BL And BR
- Align the application to the bottom-left and bottom-right
corner, respectively, of the browser window and crop the top and
remaining right or left side as needed.
If this attribute
is omitted, the content is centered in the browser window.
Value: L | R | T | B | TL | TR | BL | BR
Template
variable: $SA
- base attribute
- (Optional)
Specifies the base directory or URL used to resolve all relative
path statements in the SWF file. This attribute is helpful when
you keep SWF files in a different folder from your other files.
Value:
base directory or URL
- menu attribute or parameter
- (Optional)
Specifies what type of menu appears when the viewer right-clicks
(Windows) or Command-clicks (Macintosh) the application area in
the browser.
- true
- shows the full menu, which gives the user several options
to enhance or control playback.
- false
- shows a menu that contains only the About Adobe Flash Player
6 option and the Settings option.
The default value is true if
this attribute is omitted.
Value: true | false
Template
variable: $ME
- wmode attribute or parameter
- (Optional)
Lets you use the transparent Flash content,
absolute positioning, and layering capabilities available in Internet
Explorer 4.0. For a list of browsers this attribute/parameter supports,
see Publishing Flash documents. The wmode paramater is
also used for hardware acceleration in Flash Player 9 and later.
- Window
- Plays the application in its own rectangular window on a
web page. Window indicates that the Flash application
has no interaction with HTML layers and is always the top-most item.
- Opaque
- Makes the application hide everything behind it on the page.
- Transparent
- Makes the background of the HTML page show through all the transparent
portions of the application and can slow animation performance.
- Opaque windowless and Transparent windowless
- Both interact with HTML layers, letting layers above the
SWF file block out the application. Transparent allows transparency
so that HTML layers below the SWF file can be seen through the background
of the SWF file; opaque does not.
- Direct
- Level 1 - Direct mode hardware acceleration is turned on.
The other window mode settings apply only when hardware acceleration
is turned off.
- GPU
- Level 2 - GPU mode hardware acceleration is turned on. The
other window mode settings apply only when hardware acceleration
is turned off.
For more information about
hardware acceleration, see Specify publish settings for SWF files.
The default value is Window if
this attribute is omitted. Applies to object only.
Value: Window | Opaque | Transparent | Direct | GPU
Template
variable: $WM
- allowscriptaccess attribute or parameter
- Use allowscriptaccess to
let your Flash application communicate
with the HTML page hosting it. The fscommand() and getURL() operations
can cause JavaScript to use the permissions of the HTML page, which
can be different from the permissions of your Flash application. This has important
implications for cross-domain security.
- always
- Permits scripting operations at all times.
- never
- Forbids all scripting operations.
- samedomain
- Permits scripting operations only if the Flash application is from the same
domain as the HTML page.
The default value that all HTML
publish templates use is samedomain.
Value: always | never | samedomain
- SeamlessTabbing parameter
- (Optional) Lets you set the ActiveX control to perform seamless
tabbing, so that the user can tab out of a Flash application.
This parameter works only in Windows with the Flash Player ActiveX control,
version 7 and higher.
- true
- (or omitted) Sets the ActiveX control to perform seamless
tabbing: After users tab through the Flash application,
the next tab keypress moves the focus out of the Flash application and into the surrounding HTML
content or to the browser status bar if nothing can have focus in
the HTML following the Flash application.
- false
- Sets the ActiveX control to behave as it did in version 6
and earlier: After users tab through the Flash application,
the next tab keypress wraps the focus around to the beginning of
the Flash application. In this mode,
you cannot use the tab key to advance the focus past the Flash application.
Value: true | false
Examples using object and embed tagsFor object,
four settings (height, width, classid,
and codebase) are attributes that appear in the object tag;
all others are parameters that appear in separate, named param tags,
as shown in the following example:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100"
height="100" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">
<param name="movie" value="moviename.swf">
<param name="play" value="true">
<param name="loop" value="true">
<param name="quality" value="high">
</object>
For the embed tag,
all settings (such as height, width, quality,
and loop) are attributes that appear between the
angle brackets of the opening embed tag, as shown
in the following example:
<embed src="moviename.swf" width="100" height="100" play="true"
loop="true" quality="high"
pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
To use both tags, position the embed tag
before the closing object tag, as shown in the
following example:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100"
height="100" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">
<param name="movie" value="moviename.swf">
<param name="play" value="true">
<param name="loop" value="true">
<param name="quality" value="high">
<embed src="moviename.swf" width="100" height="100" play="true"
loop="true" quality="high"
pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>
Note: If you use the object and embed tags,
use identical values for each attribute or parameter to ensure consistent
playback across browsers. The swflash.cab#version=9,0,0,0 parameter
is optional; only omit this parameter if you don’t want to check
for the version number.
Browsers that support windowless modes
Operating system
|
Internet Explorer
|
Netscape
|
Other
|
Macintosh OS X 10.1.5 and 10.2
|
5.1 and 5.2
|
7.0 and later
|
Opera 6 or later
Mozilla 1.0 or later
AOL/Compuserve
|
Windows
|
5.0, 5.5, and 6.0
|
7.0 and later
|
Opera 6 and later
Mozilla 1.0 and later
AOL/Compuserve
|
|