인터넷정보

What is SWFObject? SWFObject 무엇입니까? embed? object?

알 수 없는 사용자 2008. 11. 4. 13:46
설명서
Embedding Adobe Flash Player content using SWFObject 2 내장은 Adobe Flash Player 2를 사용하여 콘텐츠를 SWFObject

Translations: 번역 :

What is SWFObject? SWFObject 무엇입니까?

SWFObject 2: SWFObject 2 :

Why should you use SWFObject? 왜 SWFObject 사용해야합니까?

SWFObject 2: SWFObject 2 :

  • Is more optimized and flexible than any other Flash Player embed method around 보다 최적화된 제품입니다 및 기타 Flash Player가보다 유연하고 주위에 방법을 포함
  • Offers one solution for everybody: It shouldn't matter if you are an HTML, Flash, or JavaScript developer, there should be something in it for everyone 경우는 HTML, 플래시, 또는 자바 스크립트 개발자 모두를 위해 뭔가해야하는 모두를위한 하나의 솔루션을 제공 : 그건 문제가 안됩니다
  • Breaks the cycle of being locked into vendor specific markup and promotes the use of web standards and alternative content 의 휴식 시간주기의 특정 마크업에 감금되고 공급 업체 및 웹 표준과 다른 콘텐츠의 사용을 촉진
  • Uses unobtrusive JavaScript and JavaScript best practices 겸손한 자바 스크립트와 자바 스크립트를 사용하여 최상의 사례
  • Is easy to use 사용이 편리합니다

The A List Apart article Flash Embedding Cage Match [ http://www.alistapart.com/articles/flashembedcagematch/ ] describes the full rationale behind SWFObject 2. A 급리스트 외에도 문서는 플래시 임베딩 케이지 매치 [http://www.alistapart.com/articles/flashembedcagematch/] SWFObject이 뒤에 전체 논리를 설명합니다.

Why does SWFObject use JavaScript? 왜 자바 스크립트 SWFObject를 사용합니까?

SWFObject 2 primarily uses JavaScript to overcome issues that cannot be solved by markup alone; it: 그 마크업이 주로 자바 스크립트 SWFObject 혼자 해결할 수없는 문제를 극복하기 위해 사용하는; 그것 :

  • Detects the Flash Player version and determines whether Flash content or alternative content should be shown, to avoid that outdated Flash plug-ins break Flash content Flash Player 버전 감지 여부를 결정 플래시 콘텐츠 또는 대체 콘텐츠를 표시해야한다, 그 기한 플래시 플러그인을 피하기 위해 - 기능은 플래시 콘텐츠 휴식
  • Offers functionality to revert to alternative content in case of an outdated plug-in by means of a DOM manipulation (Note: if no Flash plug-in is installed the HTML object element automatically falls back to its nested alternative content) 플래시가없는 경우에는 Plug - in을 자동으로 중첩된 대체 콘텐츠를 다시 내리는 HTML 개체 요소가 설치되어있는 기능을 대체 콘텐츠를 제공하는 오래된 플러그의 경우 - DOM을 조작의 수단으로 (참고 :) 되돌리려
  • Offers the option to use Adobe Express Install to download the latest Flash Player 어도비는 빠른 설치를 사용하는 옵션을 제공하는 최신 Flash Player를 다운로드하려면
  • Solves the issue that older Webkit engines ignore the object element's nested param elements by using the proprietary embed element instead (Note: this is the only place where proprietary markup is used and will be phased out in a future version) 이 문제를 해결 나이가 웹킷 엔진을 대신 (참고 독점 embed 요소를 사용하여 개체 요소의 중첩된 param 요소 :이있는 유일한 장소가 어디이고 독점적인 마크업을 사용하는 단계가 될 것입니다 미래 버전에서는 무시)
  • Offers the option to publish Flash Player content with JavaScript and hereby avoid possible click-to-activate mechanisms 자바 스크립트와 함께 제공하는 옵션에 의거하여 Flash Player의 콘텐츠를 게시할 수 피하 - 누릅니다 - 메커니즘을 활성화
  • Offers an elaborate JavaScript API to perform common Flash Player and Flash content related tasks 자바 스크립트 API를 제공하는 정교한 공통점이 플래시 플레이어와 플래시 콘텐츠 관련 작업을 수행하도록

Should I use the static or dynamic publishing method? 나는 정적 또는 동적 출판 방법을 사용해야합니까?

SWFObject 2 offers two distinct methods to embed Flash Player content: Flash Player는 내용이 포함 SWFObject 두 가지 별개의 방법을 제공합니다 :

  1. The static publishing method embeds both Flash content and alternative content using standards compliant markup, and uses JavaScript to resolve the issues that markup alone cannot solve 정적 게시 방법이며, 플래시 콘텐츠와 다른 콘텐츠를 모두 내장되어 및 JavaScript를 사용하여 표준을 준수하는 마크업 그 마크업 혼자 해결할 수없는 문제를 해결하는 데 사용
  2. The dynamic publishing method is based on marked up alternative content and uses JavaScript to replace this content with Flash content if the minimal Flash Player version is installed and enough JavaScript support is available (similar like previous versions of SWFObject and UFO) 동적 출판 방식에 기반을 대체 콘텐츠를 표시 및 JavaScript를 사용하는 플래시 콘텐츠와이 콘텐츠를 교체하는 경우에는 최소한의 Flash Player 버전과 자바 스크립트를 지원 설치된만큼 사용할 수있습니다 (SWFObject 그리고 UFO의 이전 버전처럼 이와 유사한 것)

The advantages of the static publishing method are: 정적 게시 방법의 장점은 무엇인가요 :

  1. The actual authoring of standards compliant markup is promoted 표준을 준수하는 마크업의 실제 제작 추진
  2. The mechanism of embedding Flash content does not rely on a scripting language, so your Flash content can reach a significant bigger audience: 귀하의 Flash 내용이 상당히 큰 관객 스크립팅 언어에 의존하지 않는 플래시 콘텐츠를 내장의 메커니즘, 그래서 도달할 수 :
    • If you have the Flash plug-in installed, but have JavaScript disabled or a use a browser that doesn't support JavaScript, you will still be able to see your Flash content 경우지만, 자바 스크립트를 사용하여하거나 JavaScript를 지원하지 않는 브라우저, 당신은 여전히 귀하의 플래시 콘텐츠를 볼 수있을 것이다 중지시켰습니다은 Flash Plug - in을 설치했습니다
    • Flash will now also run on a device like Sony PSP, which has very poor JavaScript support 플래시 지금도 소니의 PSP는 매우 가난했다처럼 자바 스크립트를 지원하는 장치에 게재됩니다
    • Automated tools like RSS readers are able to pick up Flash content RSS 리더와 같은 자동화된 도구를 플래시 콘텐츠를 잡을 수있다

The advantages of the dynamic publishing method are: 동적 게시 방법의 장점은 무엇인가요 :

  1. It avoids click-to-activate mechanisms to activate active content in Internet Explorer 6/7 and Opera 9+. 클릭 -하는 메커니즘을 활성화 피한다 - Internet Explorer 6에서 액티브 콘텐츠 / 7과 오페라 9 활성화 +. Please note that Microsoft is currently phasing out all active content from its Internet Explorer browsers [ http://blogs.msdn.com/ie/archive/2007/11/08/ie-automatic-component-activation-changes-to-ie-activex-update.aspx ] 유의하시기 바랍니다 MS는 현재 자사의 인터넷 익스플로러에서 액티브 콘텐츠의 모든 단계는 [http://blogs.msdn.com/ie/archive/2007/11/08/ie-automatic-component-activation-changes-to-ie - 액티브 X - update.aspx]
  2. It integrates very well with scripted applications 대본이 잘 애플 리케이션 통합

How to embed Flash Player content using SWFObject static publishing 내장 플래시 플레이어의 콘텐츠를 게시하는 방법에 정적 SWFObject를 사용하여

STEP 1: Embed both Flash content and alternative content using standards compliant markup 1 단계 : Flash 내용을 모두 포함하고 대안을 사용하여 콘텐츠를 표준 준수 마크업

SWFObject's base markup uses the nested-objects method (with proprietary Internet Explorer conditional comments) [ http://www.alistapart.com/articles/flashembedcagematch/ ] to ensure the most optimal cross-browser support by means of markup only, while being standards compliant and supporting alternative content [ http://www.bobbyvandersluis.com/flashembed/testsuite/ ]: SWFObject의 기본 마크업 독점 Internet Explorer를 조건부 코멘트 () [http://www.alistapart.com/articles/flashembedcagematch/] 가장 최적의 크로스 - 마크업의 뜻에 의해 브라우저를 지원할 수 있도록 중첩된 - 개체의 메소드를 사용하는 전용되는 동안 표준 준수 및 지원 대체 콘텐츠 [http://www.bobbyvandersluis.com/flashembed/testsuite/] :

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject - step 1</title> <title-override>로 SWFObject - 1 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   
</head> </ 머리>
   
<body><body>
     
<div> <div> 서비스

       
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420"> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" <object height="420">
         
<param name="movie" value="myContent.swf" /> <PARAM name="movie" value="myContent.swf" />
         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
<object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"> <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
         
<!--<![endif]--> <!--<![ 각각 endif] ->
           
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>

         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
</object> </ 객체>
         
<!--<![endif]--> <!--<![ 각각 endif] ->
       
</object> </ 객체>


     
</div> </ div는>

   
</body> </ 몸>

 
</html> </ html로>

NOTE: The nested-objects method requires a double object definition (the outer object targeting Internet Explorer and the inner object targeting all other browsers), so you need to define your object attributes and nested param elements twice. 참고 : 중첩된 - 개체 메서드는 두 개체 정의가 필요 (외부 개체가 Internet Explorer와 다른 모든 브라우저 내부 개체를 대상으로 타겟팅), 그래서 당신을 두 번 특성과 중첩된 개체 param 요소를 정의해야합니다.

Required attributes: 필수 속성 :

  • classid (outer object element only, value is always clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 ) ClassID가 (외부 개체 요소에만 가치를 항상 CLSID가있다 : D27CDB6E - AE6D - 11CF - 96B8 - 444553540000)
  • type (inner object element only, value is always application/x-shockwave-flash ) 유형 (내부 object 요소에만 가치를 항상 응용 프로그램입니다 /는 x - 충격파 - 플래시)
  • data (inner object element only, defines the URL of a SWF) 데이터 (내부 object 요소에만)적인 SWF의 URL 정의
  • width (both object elements, defines the width of a SWF) 너비 (두 개체 요소)의 넓이를 정의 SWF는
  • height (both object elements, defines the height of a SWF) 높이 (두 개체 요소)적인 SWF의 높이를 정의

Required param element: 구비 param 요소 :

  • movie (outer object element only, defines the URL of a SWF) 영화 (외부 개체 요소에만)적인 SWF의 URL 정의

NOTE: We advise not to use the codebase attribute to point to the URL of the Flash plugin installer on Adobe's servers, because this is illegal according to the specifications which restrict its access to the domain of the current document only. 참고 : 우리는 어도비의 서버에서 Flash 플러그인을 설치의 URL을 가리 키도록 codebase 속성을 사용하지 마십시오, 왜냐하면,이 밖에 현재 문서의 도메인에 자사의 액세스를 제한할 사양에 따라 불법입니다. We recommend the use of alternative content with a subtle message that a user can have a richer experience by downloading the Flash plugin instead. 우리가 미묘한 메시지와 함께 사용자를 대신 플래시 플러그인을 다운로드하여 풍부한 경험을 가질 수 대안 콘텐츠의 사용을 권장합니다.

How can you use HTML to configure your Flash content? Flash 내용을 어떻게 구성하여 HTML을 사용할 수 있습니까?

You can add the following often-used optional attributes [ http://www.w3schools.com/tags/tag_object.asp ] to the object element: 당신은 종종 - [http://www.w3schools.com/tags/tag_object.asp] object 요소 : 선택적 특성을 사용하는 다음을 추가할 수있습니다

  • id 아이다호
  • name 이름
  • class 클래스
  • align 정렬할

You can use the following optional Flash specific param elements [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 ]: 당신] 다음 옵션으로 플래시 특정 param 요소 [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 사용할 수있습니다 :

Why should you use alternative content? 왜 대체 콘텐츠를 사용해야합니까?

The object element allows you to nest alternative content inside of it, which will be displayed if Flash is not installed or supported. object 요소 안에 둥지를 대체 콘텐츠를 그것의 경우 지원하는 플래시가 설치되지 않았거나 표시됩니다하실 수있습니다. This content will also be picked up by search engines, making it a great tool for creating search-engine-friendly content. 이 콘텐츠는 검색 엔진으로 검색을 만들기위한 아주 훌륭한 도구가 될 수있게 pick up됩니다 - 엔진 - 친화적인 콘텐츠입니다. Summarizing, you should use alternative content when you like to create content that is accessible for people who browse the Web without plugins [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement_03.html ], create search-engine-friendly content [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement_04.html ] or tell visitors that they can have a richer user experience by downloading the Flash plug-in. 요약하면 콘텐츠를 사용해야하는 대안을 만들 때 같은 콘텐츠 플러그인없이 누구 [http://www.adobe.com/devnet/flash/articles/progressive_enhancement_03.html] 웹을 검색하는 사람들을 위해, 검색을 만들 액세스할 - 엔진 - 친화적인 콘텐츠 [http://www.adobe.com/devnet/flash/articles/progressive_enhancement_04.html] 또는 그 사람들이 플래시 플러그인을 다운로드하여 풍부한 사용자 경험을 가질 수 -에서 방문자를 말해.

STEP 2: Include the SWFObject JavaScript library in the head of your HTML page 2 단계 : 귀하의 HTML 페이지의 머리에 자바 스크립트 라이브러리를 포함 SWFObject

The SWFObject library consists of one external JavaScript file. 하나는 외부 JavaScript 파일은 SWFObject 라이브러리로 구성되어있습니다. SWFObject will be executed as soon as it is read and will perform all DOM manipulations as soon as the DOM is loaded - for all browsers that support this, like IE, Firefox, Safari and Opera 9+ - or otherwise as soon as the onload event fires: SWFObject가 끝나자 마자 읽기 및 실행 될대로 DOM은 로드된 모든 DOM 조작을 수행할 것입니다 -이 모든 브라우저에 대한 지원, 인터넷 익스플로러, 파이어 폭스, 사파리와 오페라 9처럼 + - 또는 기타 가능한 빨리 onload 이벤트로 화재 :

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject - step 2</title> <title-override>로 SWFObject - 2 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

     
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"> </ 스크립트>

   
</head> </ 머리>
   
<body><body>
     
<div> <div> 서비스
       
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420"> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" <object height="420">
         
<param name="movie" value="myContent.swf" /> <PARAM name="movie" value="myContent.swf" />
         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
<object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"> <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
         
<!--<![endif]--> <!--<![ 각각 endif] ->
           
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>

         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
</object> </ 객체>
         
<!--<![endif]--> <!--<![ 각각 endif] ->
       
</object> </ 객체>

     
</div> </ div는>

   
</body> </ 몸>

 
</html> </ html로>

STEP 3: Register your Flash content with the SWFObject library and tell SWFObject what to do with it the SWFObject 도서관과 함께 3 단계 : 등록하여 플래시 콘텐츠 및 뭘 할 얘기 SWFObject

First add a unique id to the outer object tag that defines your Flash content. 먼저 귀하의 플래시 콘텐츠를 정의하는 외부 개체의 고유 ID 태그를 추가할 수있습니다. Second add the swfobject.registerObject method: 두 번째 방법 swfobject.registerObject 추가 :

  1. The first argument (String, required) specifies the id used in the markup. 첫 번째 인수 (문자열, 필수) ID를 마크업에 사용을 지정합니다.
  2. The second argument (String, required) specifies the Flash player version your content is published for. 두 번째 인수 (문자열, 필요)를 귀하의 콘텐츠에 대한 출판되는 플래시 플레이어 버전을 지정합니다. It activates the Flash version detection for a SWF to determine whether to show Flash content or force alternative content by doing a DOM manipulation. 그것에 대한 여부는 DOM 조작을 수행하여 SWF는 플래시 콘텐츠 또는 강제로 대체 콘텐츠를 표시할지 결정하는 Flash 버전 감지 기능을 활성화한다. While Flash version numbers normally consist of major.minor.release.build, SWFObject only looks at the first 3 numbers, so both "WIN 9,0,18,0" (IE) or "Shockwave Flash 9 r18 " (all other browsers) will translate to "9.0.18". 반면 major.minor.release.build 플래시 버전 번호가 정상적으로 이루어져, 최초 3 개의 숫자에 불과 SWFObject, 그래서 모두 9,0,18,0 "당첨"(IE)를 또는 "에 Shockwave Flash 9 r18"(다른 모든 브라우저에서 보이는 ) 9.0.18 ""번역할 예정이다.
  3. The third argument (String, optional) can be used to activate Adobe express install [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 ] and specifies the URL of your express install SWF file. 세번째 인자 (문자열, 별매)를 어도비의 설치 [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 표현] SWF 파일을 설치하여 표현의 URL을 지정 활성화 사용할 수있습니다. Express install displays a standardized Flash plugin download dialog instead of your Flash content when the required plugin version is not available. Express를 대신하여 Flash 내용이 때 필요한 플러그인 버전을 사용할 수없습니다 표준 Flash 플러그인을 다운로드 대화 상자를 표시하여 설치하십시오. A default expressInstall.swf file is packaged with the project. 기본 expressInstall.swf 파일은 프로젝트에 함께 패키지되어있습니다. It also contains the corresponding expressInstall.fla and AS files (in the SRC directory) to let you create your own custom express install experience. 그것은 또한 SRC 디렉터리 ()에서 사용자 경험을 설치하면 자신의 표현을 만들 수 있도록 해당 expressInstall.fla와 AS 파일이 포함되어있습니다. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px. 유의하시기 바랍니다 단 한번 (그것이 호출이 처음이다)의 불 '을 설치, 그게 유일한 Flash Player는 6.0.65 또는 승 또는 Mac 플랫폼에 높은 의해 지원됩니다, 그리고 그것을 표현 310x137px의 최소한의 SWF는 크기가 필요합니다.
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject - step 3</title> <title-override>로 SWFObject - 3 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"> </ 스크립트>

     
<script type="text/javascript"> <script type="text/javascript">
     
swfobject.registerObject("myId", "9.0.0", "expressInstall.swf"); swfobject.registerObject ( ""myId, "9.0.0", "expressInstall.swf");
     
</script> </ 스크립트>

   
</head> </ 머리>
   
<body><body>
     
<div> <div> 서비스

       
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420"> <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">

         
<param name="movie" value="myContent.swf" /> <PARAM name="movie" value="myContent.swf" />
         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
<object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"> <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
         
<!--<![endif]--> <!--<![ 각각 endif] ->
           
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>

         
<!--[if !IE]>--> <!--[면! IE의 ]>-->
         
</object> </ 객체>
         
<!--<![endif]--> <!--<![ 각각 endif] ->
       
</object> </ 객체>

     
</div> </ div는>

   
</body> </ 몸>

 
</html> </ html로>

TIPS

How to embed Flash Player content using SWFObject dynamic publishing 내장 플래시 플레이어 SWFObject 동적 콘텐츠를 게시하는 방법을 사용하여

STEP 1: Create alternative content using standards compliant markup 1 단계 : 대안을 준수 마크업 표준을 사용하여 콘텐츠 만들기

SWFObject's dynamic embed method follows the principle of progressive enhancement [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement.html ] and replaces alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. SWFObject의 역동적인 진보를 포함하는 방법을 개선 [http://www.adobe.com/devnet/flash/articles/progressive_enhancement.html의 원칙]은 다음과 플래시 콘텐츠에 대한 충분한 대안이 HTML 콘텐츠를 대체하는 자바 스크립트 및 플래시 플러그인 -에 해당하는 경우에 지원됩니다 . First define your alternative content and label it with an id : 먼저 귀하의 대체 콘텐츠를 정의하고 ID를 함께 레이블 :

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject dynamic embed - step 1</title> <title-override>로 포함 SWFObject 동적 - 1 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   
</head> </ 머리>
   
<body><body>
   
     
<div id="myContent"> id="myContent">를 <div
       
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>
     
</div> </ div는>
   
   
</body> </ 몸>
 
</html> </ html로>

STEP 2: Include the SWFObject JavaScript library in the head of your HTML page 2 단계 : 귀하의 HTML 페이지의 머리에 자바 스크립트 라이브러리를 포함 SWFObject

The SWFObject library consists of one external JavaScript file. 하나는 외부 JavaScript 파일은 SWFObject 라이브러리로 구성되어있습니다. SWFObject will be executed as soon as it is read and will perform all DOM manipulations as soon as the DOM is loaded - for all browsers that support this, like IE, Firefox, Safari and Opera 9+ - or otherwise as soon as the onload event fires: SWFObject가 끝나자 마자 읽기 및 실행 될대로 DOM은 로드된 모든 DOM 조작을 수행할 것입니다 -이 모든 브라우저에 대한 지원, 인터넷 익스플로러, 파이어 폭스, 사파리와 오페라 9처럼 + - 또는 기타 가능한 빨리 onload 이벤트로 화재 :

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject dynamic embed - step 2</title> <title-override>로 포함 SWFObject 동적 - 2 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
     
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"> </ 스크립트>

   
</head> </ 머리>
   
<body><body>
     
<div id="myContent"> id="myContent">를 <div
       
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>
     
</div> </ div는>
   
</body> </ 몸>
 
</html> </ html로>

STEP 3: Embed your SWF with JavaScript 3 단계 : 소스 자바 스크립트를 사용하여 SWF는

swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes) has five required and four optional arguments: swfobject.embedSWF (,, 너비, 높이 아이디, 버전, expressInstallSwfurl, flashvars swfUrl, 매개 변수, 속성) 5하고 4 선택적 인수가 필요했다 :

  1. swfUrl (String, required) specifies the URL of your SWF swfUrl (문자열, 필수) 귀하적인 SWF의 URL을 지정
  2. id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content 아이디 (문자열, 필수) ()하면 플래시 콘텐츠로 대체해야하고 싶습니다 대체 콘텐츠가 포함된 HTML 요소의 id를 지정합니다
  3. width (String, required) specifies the width of your SWF 너비 (문자열, 필수)의 넓이를 지정하여 SWF는
  4. height (String, required) specifies the height of your SWF 높이 (문자열, 필수)의 높이를 지정하여 SWF는
  5. version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release") 버전 (문자열, 필요)를 귀하의 SWF는 (형식에 대한 출판되는 플래시 플레이어 버전을 지정합니다 : "major.minor.release")
  6. expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 ]. expressInstallSwfurl (문자열, 별매)를 설치하는 SWF는 표현의 URL을 지정하고 어도비 [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 설치하는 표현을 활성화]. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px. 유의하시기 바랍니다 단 한번 (그것이 호출이 처음이다)의 불 '을 설치, 그게 유일한 Flash Player는 6.0.65 또는 승 또는 Mac 플랫폼에 높은 의해 지원됩니다, 그리고 그것을 표현 310x137px의 최소한의 SWF는 크기가 필요합니다.
  7. flashvars (Object, optional) specifies your flashvars with name:value pairs flashvars (개체, 별매)의 이름을 가진 네 flashvars : 값 쌍을 지정
  8. params (Object, optional) specifies your nested object element params with name:value pairs 매개 변수 (개체, 별매)의 이름을 가진 당신의 중첩된 object 요소 매개 변수 : 값 쌍을 지정
  9. attributes (Object, optional) specifies your object 's attributes with name:value pairs 특성 (개체, 별매)의 이름과 특성이 귀하의 개체 ': 값 쌍을 지정

NOTE: You can omit the optional parameters, as long as you don't break the parameter order. 참고 : 매개 변수를 순서대로 깨지 말아야 할 당신은 생각 이상으로 오래 선택적 매개 변수를 생략할 수있습니다. If you don't want to use an optional parameter, but would like to use a following optional parameter, you can simply pass false as its value. 선택적 매개 변수를 사용하는 경우, 원하지 않는하지만 다음 선택적 매개 변수를 사용하려는 경우, 당신은 단순히 자사의 가치를 허위로 전달할 수있습니다. For the flashvars , params and attributes JavaScript Objects, you can also pass an empty object instead: {} . the flashvars 들어, 매개 변수자바 스크립트 객체 특성, 당신도 대신 빈 개체를 전달할 수있습니다 : ().

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!을 DOCTYPE html로 행정 "- / /는 W3C / / DTD를는 XHTML 1.0 Strict는 / / 엉" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> xmlns="http://www.w3.org/1999/xhtml" lang="en" <html xml:lang="en">
   
<head><head>
     
<title>SWFObject dynamic embed - step 3</title> <title-override>로 포함 SWFObject 동적 - 3 단계 </ 제목>
     
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     
<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"> </ 스크립트>
   
     
<script type="text/javascript"> <script type="text/javascript">
     
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0"); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0");
     
</script> </ 스크립트>

   
</head> </ 머리>
   
<body><body>
     
<div id="myContent"> id="myContent">를 <div
       
<p>Alternative content</p> <p> 대체 콘텐츠 </ p 서비스>
     
</div> </ div는>
   
</body> </ 몸>
 
</html> </ html로>

How can you configure your Flash content? 귀하의 플래시 콘텐츠를 어떻게 구성할?

You can add the following often-used optional attributes [ http://www.w3schools.com/tags/tag_object.asp ] to the object element: 당신은 종종 - [http://www.w3schools.com/tags/tag_object.asp] object 요소 : 선택적 특성을 사용하는 다음을 추가할 수있습니다

  • id (NOTE: when undefined, the object element automatically inherits the id from the alternative content container element) 아이디 (참고 : 때, 오브젝트 요소가 undefined로 대체 콘텐츠를 자동으로 컨테이너 요소에서) ID를 상속
  • name 이름
  • styleclass (used instead of class , because this is also an ECMA4 reserved keyword) 왜냐하면,이 또한 ECMA4 키워드를 소유) styleclass (대신 클래스 사용
  • align 정렬할

You can use the following optional Flash specific param elements [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 ]: 당신] 다음 옵션으로 플래시 특정 param 요소 [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 사용할 수있습니다 :

How do you use JavaScript Objects to define your flashvars, params and object's attributes? 자바 스크립트 객체 어떻게 당신 flashvars, 매개 변수 및 개체의 특성을 정의하는 데 사용합니까?

You can best define JavaScript Objects using the Object literal notation, which looks like: 당신을 가장 닮은 개체 상수값을 사용하는 자바 스크립트 객체를 정의할 수있습니다 :

 <script type="text/javascript"> <script type="text/javascript"> 

 
var flashvars = {}; var flashvars = ();
 
var params = {}; var 매개 변수 = ();
 
var attributes = {}; var 특성 = ();

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, 매개 변수, 속성);

 
</script> </ 스크립트>

You can add your name:value pairs while you define an object (note: please make sure not to put a comma behind the last name:value pair inside an object) 동안 (참고 : 주시기 바랍니다 마지막 이름 : value 쌍을 개체 안으로 넣어 쉼표 뒤에 안을) 개체 정의 당신의 이름 : 값 쌍을 추가할 수있습니다

 <script type="text/javascript"> <script type="text/javascript"> 

 
var flashvars = { var flashvars = (
   
name1: "hello", name1 : "안녕하세요",
   
name2: "world", name2 : "세계",
   
name3: "foobar" name3 : "는 foobar"
 
}; );
 
var params = { var 매개 변수 = (
   
menu: "false" 메뉴 : "거짓"
 
}; );
 
var attributes = { var 특성 = (
   
id: "myDynamicContent", 아이디 : "myDynamicContent",
   
name: "myDynamicContent" 이름 : "myDynamicContent"
 
}; );

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, 매개 변수, 속성);

 
</script> </ 스크립트>

Or add properties and values after its creation by using a dot notation: 도트 표기법을 사용하여 생성된 후 또는 속성과 값을 추가 :

 <script type="text/javascript"> <script type="text/javascript"> 

 
var flashvars = {}; var flashvars = ();
 
flashvars.name1 = "hello"; flashvars.name1 = "안녕하세요";
 
flashvars.name2 = "world"; flashvars.name2 = "세계";
 
flashvars.name3 = "foobar"; flashvars.name3 = "는 foobar";

 
var params = {}; var 매개 변수 = ();
 
params.menu = "false"; params.menu = ""거짓;

 
var attributes = {}; var 특성 = ();
 
attributes.id = "myDynamicContent"; attributes.id = "myDynamicContent";
 
attributes.name = "myDynamicContent"; attributes.name = "myDynamicContent";

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, 매개 변수, 속성);

 
</script> </ 스크립트>

Which can also be written as (the less readable shorthand version for the die-hard scripter who love one-liners): 죽어도 (덜 읽을 속기 버전 - 하드 scripter로 한 - 라이너 사랑)를 작성할 수있습니다 :

 <script type="text/javascript"> <script type="text/javascript"> 

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", {name1:"hello",name2:"world",name3:"foobar"}, {menu:"false"}, {id:"myDynamicContent",name:"myDynamicContent"}); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", (name1 : "안녕하세요", name2 : "세계", name3 : " 는 foobar "), (메뉴 :"거짓 "), (아이디 :"myDynamicContent "이름 :"myDynamicContent "));

 
</script> </ 스크립트>

If you don't want to use an optional argument you can define it as false or as an empty Object (NOTE: from SWFObject 2.1 onwards you can also use null or 0 ): 만약 당신이 허위 또는 비어있는 개체로 (참고 : SWFObject 2.1 이후부터도)는 null 또는 0에서 사용할 수있는만큼 그것을 정의할 수있는 선택적 인수를 사용하지 않으려면 :

 <script type="text/javascript"> <script type="text/javascript"> 

 
var flashvars = false; var flashvars = 허위;
 
var params = {}; var 매개 변수 = ();
 
var attributes = { var 특성 = (
   
id: "myDynamicContent", 아이디 : "myDynamicContent",
   
name: "myDynamicContent" 이름 : "myDynamicContent"
 
}; );

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, 매개 변수, 속성);

 
</script> </ 스크립트>

The flashvars Object is a shorthand notation that is there for your ease of use. 개체가 이미 사용하는 귀하의 완화에 대한 속기 표기법입니다 flashvars. You could potentially ignore it and specify your flashvars via the params Object: 당신이 잠재적으로 그것을 무시할 수와 매개 변수 개체를 통해 귀하의 flashvars를 지정해야합니다 :

 <script type="text/javascript"> <script type="text/javascript"> 

 
var flashvars = false; var flashvars = 허위;
 
var params = { var 매개 변수 = (
   
menu: "false", 메뉴 : "거짓",
   
flashvars: "name1=hello&name2=world&name3=foobar" flashvars : "name1 = 안부 & name2 = 세계 & name3 =는 foobar"
 
}; );
 
var attributes = { var 특성 = (
   
id: "myDynamicContent", 아이디 : "myDynamicContent",
   
name: "myDynamicContent" 이름 : "myDynamicContent"
 
}; );

 
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); swfobject.embedSWF ( "myContent.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf", flashvars, 매개 변수, 속성);

 
</script> </ 스크립트>

TIPS

SWFObject 1.5 to SWFObject 2 migration tips SWFObject 1.5이 마이 그 레이션 팁 SWFObject로

  1. SWFObject 2 is NOT backwards compatible with SWFObject 1.5 거꾸로 SWFObject 1.5와 호환이되지 않을 SWFObject
  2. It is now preferred to insert all script blocks in the head of your HTML page. 이제 여러분의 HTML 페이지의 머리에있는 모든 스크립트 블록을 삽입하는 것이 좋습니다. Adding your scripts in the body of your page may have visual impact (eg flashes of replaced alternative content), because your JavaScript code will be executed in a later stage (the exact impact depends on your implementation) 귀하의 자바 스크립트 코드가 있기 때문에 나중에 무대에서 (정확한 영향을 실행되며 페이지의 본문에 여러분이 만든 스크립트에 추가 ()으로 대체 대안이 콘텐츠의 섬광 예, 시각적인 영향을 미칠 수있습니다 귀하의 구현에 따라 다름)
  3. The library itself is now written in lowercase: swfobject instead of SWFObject 도서관 자체가 지금은 소문자로 작성된 것입니다 : 대신 SWFObject swfobject
  4. Methods can only be accessed via the library (instead via a SWFObject instance in SWFObject 1.5) 유일한 방법은 도서관 (경유 SWFObject 1.5에서 SWFObject를 통해 인스턴스를 대신)에 액세스할 수있습니다
  5. The API is entirely different and more elaborate: [ http://code.google.com/p/swfobject/wiki/api ] API를 완전히과 더 정교한 : [http://code.google.com/p/swfobject/wiki/api 다르다]
  6. SWFObject 2 replaces your entire alternative HTML content block, including the referenced HTML container element, for Flash content when enough JavaScript and Flash support is available, while SWFObject 1.5 only replaces the content inside the referenced HTML container. 이 플래시 콘텐츠를위한 컨테이너 SWFObject 참조된의 HTML 요소를 포함하여 전체 대안 HTML 콘텐츠를 차단, 자바 스크립트와 플래시를 지원하면 충분히 가능합니다, SWFObject 1.5 참조된 유일의 HTML 컨테이너 안의 콘텐츠를 대체하는 대체합니다. When you don't specify an id attribute, the object element will automatically inherit the id of the HTML container element of your alternative content. 때 id 속성을 지정하지 않으면, 오브젝트 요소를 자동으로 대체 콘텐츠의 HTML 컨테이너 요소의 id를 상속한다.

UFO to SWFObject 2 migration tips UFO가이 마이 그 레이션 팁 SWFObject로

  1. SWFObject 2 replaces your entire alternative HTML content block, including the referenced HTML container element, for Flash content when enough JavaScript and Flash support is available, while UFO only replaces the content inside the referenced HTML container. 이 플래시 콘텐츠를위한 컨테이너 SWFObject 참조된의 HTML 요소를 포함하여 전체 대안 HTML 콘텐츠를 차단, 자바 스크립트 및 플래시 지원을 사용할 때 충분한 반면, UFO를 참조하는 HTML을 컨테이너 안에서만 콘텐츠를 대체하는 대체합니다. When you don't specify an id attribute, the object element will automatically inherit the id of the HTML container element of your alternative content. 때 id 속성을 지정하지 않으면, 오브젝트 요소를 자동으로 대체 콘텐츠의 HTML 컨테이너 요소의 id를 상속한다.
  2. UFO's setcontainercss feature has not been incorporated in SWFObject 2, however it can easily be replicated by using the SWFObject JavaScript API, see: swfobject.createCSS(selStr, declStr) in [ http://code.google.com/p/swfobject/wiki/api ] UFO가의 setcontainercss 기능 SWFObject 2, 그러나 쉽게 SWFObject 자바 스크립트 API를 사용하여, 참조 : swfobject.createCSS (selStr, declStr)에서 [복제될 수있습니다 http://code.google.com/p/swfobject/ 통합되지 않았습니다 위키 / API를]

Does SWFObject 2 support MIME type application/xhtml+xml? SWFObject 2 지원 MIME 타입 않는 응용 프로그램 / xhtml + xml과?

SWFObject 2 does NOT support XML MIME types, which is a design decision. SWFObject 2는 디자인 결정이 지원은 XML MIME 형식, 않습니다.

There are a number of reasons why we are not supporting this: 거기에 여러 가지 이유로 우리가 왜이 지원되지 않습니다 :

  • Only a very small (non-significant) amount of web authors is using it 아주 조금 밖에 (비 - 웹 저작자의 상당) 금액이 작은 그것을 사용하고있습니다
  • We are unsure if it is the direction to go. 갈 방향이있다면 우리는 확신하고있다. Internet Explorer does not support it and all other major browser vendors are aiming their arrows at a new standard way of HTML parsing (with HTML 5), which departs from the current W3C vision of parsing HTML as XML Internet Explorer와 그것을 지원하지 않는 다른 모든 주요 브라우저 벤더는 HTML 구문 분석의 새로운 표준 방식의 HTML 5 ()를 가지고있는 XML로 HTML을 파싱의 현재 W3C의 비전에서 출발합니다 그들의 화살을 목표로 삼고있다
  • We save a considerate amount of file size and effort (testing, issue resolving) by not supporting it 우리가 파일의 크기와 노력의 배려 금액 그것을 지원하지 않음으로써 (테스트, 문제 해결)에 저장

Tutorials (beginner level) 자습서 (초급 레벨)

Comments 코멘트

The comments functionality on this wiki has been switched off to avoid spam and abuse. 이 위키에 대한 코멘트 스팸 및 남용 방지 기능이 꺼질왔다.

If you have any questions/comments about SWFObject or its documentation, or have problems with an implementation: 질문이 있으면 언제든지 / SWFObject이나 설명서에 대한 의견이나 문제가 구현 :

  1. Please make sure you have read our FAQ [ http://code.google.com/p/swfobject/wiki/faq ] 제발 우리의 FAQ를 [http://code.google.com/p/swfobject/wiki/faq을 읽고 있는지 확인]
  2. Use the SWFObject discussion group [ http://groups.google.com/group/swfobject ] the SWFObject 토론 그룹을 사용하여 [http://groups.google.com/group/swfobject]

If you find any bugs or want to request a future enhancement, you can fill in an issue report on the SWFObject issues page [ http://code.google.com/p/swfobject/issues/list ] 버그를 찾았 다 던지 있으면 언제든지 미래를 강화하려는 요청하면 문제 SWFObject 페이지에 문제가 보고서에 작성할 수있습니다 [http://code.google.com/p/swfobject/issues/list]

원문 : http://code.google.com/p/swfobject/
예제 :

반응형