Use case
This document lists the attributes of the OBJECT and EMBED tags used to publish SWF (Flash-enabled) content in HTML pages for display in web browsers. The attributes allow you to specify certain parameters that control the details of how and where Flash Player displays the SWF file in the browser.
Information about including Flash-enabled (SWF file) content within web pages is also available in the TechNote OBJECT tag syntax | Flash (tn_4150).
The following attributes are required within the OBJECT and EMBED tags when adding a SWF file to an HTML page. The Publish command in Flash Professional creates HTML files with the required attributes specified for you.
Note: Values in brackets and italics indicate that the developer chooses the value.
The following attributes are optional when defining the OBJECT and EMBED tags. For OBJECT, all attributes are defined in param tags unless otherwise specified:
Developers can set the Window Mode (wmode) property of the SWF content to control layering and transparency of the content in the browser. Regardless of the wmode value, Flash Player displays content viewed in full screen mode using direct path rendering. Using direct path rendering enables hardware accelerated presentation capabilities such as Stage Video and Stage 3D.
To deliver the highest performance playback of Flash-enabled content in the browser, use wmode=direct. This attribute enables hardware accelerated presentation capabilities, including Stage Video and Stage 3D. Avoid overlapping the SWF content with HTML elements (for example, HTML-based pop-up menus) intended to appear above the SWF file. Explicit layering control is only supported with some modern browsers (see table below). In other browsers, the SWF content always appears above other HTML elements.
If you require explicit layering control, transparency, or HTML elements that float above SWF content, use wmode=opaque or wmode=transparent. You can then control layering in relationship to other elements on the page through HTML. However, these "windowless" modes reduce playback performance compared to wmode=window (the default) and wmode=direct.
Use case |
Recommended wmode |
Best performance, including support for hardware accelerated Stage Video and Stage 3D. |
wmode=direct |
Requires overlapping HTML elements to appear on top of SWF content, transparency, or explicit layering control relative to HTML elements (across all browsers). |
wmode=opaque or wmode=transparent |
Different browsers rely on different approaches for rendering web page content and handles wmode values differently. The table above summarizes when to use different wmodes. The matrix below details the specific behaviors you can expect in each browser.
Wmode |
Benefits |
IE 6, 7, and 8 Win |
IE 9 Win |
Firefox Win |
Chrome Win |
Firefox 3 Mac (OSX 10.5 and later) |
Firefox 4 Mac (OSX 10.6 and later) |
Safari 3 (OSX 10.5) |
Safari 4 (OSX 10.6 and later) |
Chrome Mac (OSX 10.5) |
Chrome Mac (OSX 10.6 and later) |
window |
Broadest accessibility support |
-/-/A |
-/-/A |
-/-/A |
-/-/A |
-/-/- |
L/-/- |
-/-/- |
L/-/- |
-/-/- |
L/-/- |
transparent |
Transparency and alpha blending over HTML elements supported. HTML elements can overlap SWF content. Explicit layering control (all browsers) |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
opaque |
HTML elements can overlap SWF content. Explicit layering control (all browsers). |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
L/-/- |
direct |
Best performance. Hardware accelerated presentation, including Stage Video and Stage 3D (all browsers). |
-/H/A |
L/H/- |
-/H/A |
-/H/A |
-/H/- |
L/H/- |
-/H/- |
L/H/- |
-/H/- |
L/H/- |
gpu |
Additional hardware acceleration on some Internet connected TVs and mobile devices. |
-/H/A |
L/H/- |
-/H/A |
-/H/A |
-/H/- |
L/H/- |
-/H/- |
L/H/- |
-/H/- |
L/H/- |
L = HTML layering is supported. HTML elements can overlap SWF content. Supports explicit control of layering in relation to other HTML elements.
H = Hardware accelerated presentation is supported, including Stage Video and Stage 3D.
A = Accessibility is supported.
Keywords: code; value; attribute; tags; attributes; param; parameter; play; loop; quality; bgcolor; scale; salign; base; menu; width; height; src; pluginspage; movie; classid; codebase; background color; back ground color; tn_12701
Sign in to your account