DOM Flash OBJECT and EMBED tag attributes

황제낙엽 2011.03.02 16:26 조회 수 : 912

sitelink3 http://1 
sitelink4 http://ko 
extra_vars5 http://kb2.adobe.com/cps/127/tn_12701.html#main_Required_attributes 
extra_vars6 sitelink1 

Flash OBJECT and EMBED tag attributesProducts affected


Was this helpful?

This document lists the required and optional 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) content within web pages is also available in the TechNote OBJECT tag syntax | Flash (tn_4150).

Required attributes

The following attributes are required within the object and/or 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.

Required for both object and embed:
  • width - Specifies the width of the SWF content in either pixels or percentage of browser window.
  • height - Specifies the height of the SWF content in either pixels or percentage of browser window.
Required for object tag only:
  • classid - Identifies the ActiveX control for the browser. See example code in OBJECT tag syntax | Flash (tn_4150) for the correct value.
  • codebase - Identifies the location of the Flash Player ActiveX control so that the browser can automatically download it if it is not already installed. See example code in OBJECT tag syntax | Flash (tn_4150) for the correct value.
  • movie (param) - Specifies the source location (URL) of the SWF file to load.
Required for embed tag only
  • src - Specifies the source location (URL) of the SWF file to load.
  • pluginspage - Identifies the location of the Flash Player plug-in so that the user can download it if it is not already installed.

Optional attributes

The following attributes are optional when defining the object and/or embed tags. For object, all attributes are defined in param tags unless otherwise specified:

  • id (attribute for object tag) and name (attribute for embed tag) - SWF file identifier. Identifies the SWF file to the web browser, allowing browser scripting languages (e.g., JavaScript) to reference the SWF content. For cross-browser compatibility, id and name should be set to the same value.
  • play - Possible values: true, false. Specifies whether a timeline-based SWF file begins playing immediately on loading in the browser. If this attribute is omitted, the default value is true.
  • loop - Possible values: true, false. Specifies whether a timeline-based SWF file repeats indefinitely or stops when it reaches the last frame. If this attribute is omitted, the default value is true.
  • menu - Possible values: true, false. Specifies if movie playback controls are available in the Flash Player context menu.
    • true displays a full menu that provides expanded movie playback controls (e.g., Zoom, Quality, Play, Loop, Rewind, Forward, Back).
    • false displays a menu that hides movie playback controls (e.g., Zoom, Quality, Play, Loop, Rewind, Forward, Back). This is useful for SWF content that does not rely on the Timeline, such as content controlled entirely by ActionScript. The short menu will include "Settings" and "About Flash Player" menu items.
  • quality - Possible values: low, autolow, autohigh, medium, high, best. Specifies the display list Stage rendering quality. Setting the Stage.quality property via ActionScript will override this value.
    • 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 the Flash Player detects that the processor can handle it, anti-aliasing is turned on.
    • autohigh 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. Use this setting to emulate the View > Antialias setting in Flash Professional.
    • medium applies some anti-aliasing and does not smooth bitmaps. It produces a better quality than the Low setting, but lower quality than the High setting.
    • high favors appearance over playback speed and always applies anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie 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.
  • scale - Possible values: showall, noborder, exactfit, noscale. Specifies how Flash Player should scale SWF content to fit the pixel area specified by the object or embed tag.
    • default (Show all) makes the entire SWF file visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders can appear on two sides of the movie.
    • noborder scales the SWF file to fill the specified area, while maintaining the original aspect ratio of the file. Flash Player may crop the content, but no distortion will occur
    • exactfit makes the entire SWF file visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur.
    • noscale prevents the SWF file from scaling to fit the area of the object or embed tag. Cropping may occur.
  • align (attribute for Object) - Possible values: l, t, r.
    • Default centers the movie in the browser window and crops edges if the browser window is smaller than the movie.
    • l (left), r (right), and t (top) align the movie along the corresponding edge of the browser window and crop the remaining three sides as needed.
  • salign - Possible values: l, t, r, tl, tr.
    • l, r, and t align the movie along the left, right, or top edge of the browser window and crop the remaining sides as needed.
    • tl and tr align the movie to the top left and top right corner of the browser window and crop the bottom and remaining side as needed.
  • wmode - Possible values: window, direct, opaque, transparent, gpu. Sets the Window Mode property of the Flash movie for transparency, layering, positioning, and rendering in the browser. If this attribute is omitted, the default value is "window". For more information, see Using Window Mode (wmode) values below.
    • window - The SWF content plays in its own rectangle ("window") on a web page. The browser will determinehow the SWF content is layered against other HTML elements. With this value, you cannot explicitly specify if SWF content will appear above or below other HTML elements on the page.  
    • direct - Use direct to path rendering. This bypasses compositing in the screen buffer and renders the SWF content directly to the screen. This wmode value is recommended to provide the best performance for content playback and enables hardware accelerated presentation of SWF content that uses Stage Video or Stage 3D.
    • opaque - The SWF content is layered together with other HTML elements on the page. The SWF is opaque and will hide everything layered behind it on the page. This option will reduce playback perfomance compared to wmode=window or wmode=direct.
    • transparent - The SWF content is layered together with other HTML elements on the page. The SWF background color (Stage color) is transparent, and HTML elements beneath the SWF will be visible through any transparent areas of the SWF, with alpha blending. This option will reduce playback performance compared to wmode=window or wmode=direct.
    • gpu - Use additional hardware acceleration on some internet connected TVs and mobile devices. In contrast to other wmode values, pixel fidelity for display list graphics is not guaranteed. Otherwise, this value is similar to wmode=direct.
  • bgcolor - [hexadecimal RGB value] in the format #RRGGBB. Specifies the background color of the SWF content. Use this attribute to override the background color (Stage color) setting specified in the SWF file. (This attribute does not affect the background color of the HTML page.)
  • base - [base directory] or [URL]. Specifies the base directory or URL used to resolve all relative path statements in the SWF. This attribute is helpful when your SWF file is kept in a different directory from your other files.
  • allowFullScreen - Possible values: true or false. Setting this value to true will allow the SWF to enter full screen mode via ActionScript. For more information, see Exploring full screen mode in Flash Player. If this attribute is omitted, the default value is false.
  • fullScreenAspectRatio - Possible values: portrait or landscape. Used to control how full screen SWF content appears on mobile devices that support automatic screen rotation, such as phones and tablets. If this attribute is specified, Flash Player will use the specified screen orientation (portrait or landscape) when the SWF is viewed in full screen mode, regardless of how the device is oriented. If this attribute is not specified, orientation of content in full screen mode will follow the screen orientation used by the browser.  
  • flashvars - Variables, defined as a string of key=value pairs, that will be passed to the SWF file.
    • Use flashvars to specify root-level variables in the SWF. The format of the string is a set of key=value combinations separated by the '&' character.
    • Browsers support string sizes of up to 64 KB (65535 bytes) in length.
    • For more information on using flashvars, see Using FlashVars to pass variables to a SWF (tn_16417).

Using Window Mode (wmode) values 

Developers can set the Window Mode (wmode) property of the SWF content to control layering and transparency of the content in the browser. Note that regardless of the wmode value, Flash Player will display content viewed in full screen mode using direct path rendering, enabling hardware accelerated presentation capabilities such as Stage Video and Stage 3D.

To deliver the highest performance playback of Flash-enabled content in the browser, usewmode=direct to enable hardware accelerated presentation capabilities, including Stage Video and Stage 3D. Avoid overlapping the SWF content with HTML elements (e.g., HTML-based drop-down menus) intended to appear above the SWF, as explicit layering control is only supported with some modern browsers (see table below). In other browsers, the SWF content will always appear 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 will reduce playback performance compared to wmode=window (the default) and wmode=direct.

Use caseRecommended 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

Browser support for Window Mode (wmode) values

Different browsers rely on different approaches for rendering web page content and will handle 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.

WmodeBenefitsIE 6, 7, 8 WinIE 9 WinFirefox WinChrome WinFirefox 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)
windowBroadest accessibilty support-/-/A-/-/A-/-/A-/-/A-/-/-L/-/--/-/-L/-/--/-/-L/-/-
transparentTransparency 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/-/-
opaqueHTML elements can overlap SWF content. Explicit layering control (all browsers).L/-/-L/-/-L/-/-L/-/-L/-/-L/-/-L/-/-L/-/-L/-/-L/-/-
directBest performance. Hardware accelerated presentation, including Stage Video and Stage 3D (all browsers).-/H/AL/H/--/H/A-/H/A-/H/-L/H/--/H/-L/H/--/H/-L/H/-
gpuAdditional hardware acceleration on some internet connected TVs and mobile devices.-/H/AL/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.

번호 제목 글쓴이 날짜 조회 수
128 Web Speech API Example (HTML5 STT & TTS) file 황제낙엽 2025.04.14 731
127 모바일과 데스크톱을 포괄하는 사용자의 터치 이벤트(onPointerTap) 황제낙엽 2025.04.09 648
126 Web RTC 에 관하여 황제낙엽 2024.11.20 626
125 div와 span의 차이점 (from Bing) 황제낙엽 2023.06.16 685
124 flexbox (flexible box layout) 황제낙엽 2023.02.27 641
123 characters from ISO 8859-1 황제낙엽 2020.11.10 36946
122 HTML FRAMESET 태그 예제 황제낙엽 2020.11.06 718
121 스마트 기기에서 여러 단말기의 해상도에 대응하기 위해 사용하는 HTML viewport meta tag 황제낙엽 2020.11.06 644
120 네이버의 무료 나눔 글꼴 황제낙엽 2020.05.06 1762
119 서버의 이미지나 txt 파일을 웹브라우저에서 다운로드하기 황제낙엽 2019.05.13 867
118 When to encode space to plus (+) or %20? (application/x-www-form-urlencoded) 황제낙엽 2019.04.15 917
117 HTTP/2 소개 황제낙엽 2018.10.12 693
116 글자, 문자, 텍스트, 글꼴, 서체, 폰트와 관련한 속성들 / font-size , 크기 단위(em, px, pt, rem), 절대 단위, 상대 단위 황제낙엽 2018.04.18 842
115 Pragma와 Cache-Control 황제낙엽 2018.03.28 845
114 로드밸런싱(L4)+아파치를 운영시 etag제거로 캐시 성능 최적화 file 황제낙엽 2018.03.28 944
113 HTTP 요청 헤더 III - If-Match, If-Modified-Since, If-None-Match file 황제낙엽 2018.03.27 726
112 재미난 로그인 페이지 만들기 file 황제낙엽 2018.03.26 1592
111 HTTP Cache-Control 요청 지시어 황제낙엽 2018.03.09 713
110 내 웹사이트의 속도를 빠르게! file 황제낙엽 2018.03.07 859
109 성능을 위한 초간단 HTTP 304 Not Modified 구현 방법 file 황제낙엽 2018.03.07 816