Adobe HTML 문서에 SWF 파일 삽입하기
페이지 정보
본문
1. flashObj.js 파일 생성
/*
IE Flash ActiveContent Activation Script
Author: Faisal Iqbal (chall3ng3r)
Blog:http://www.orison.biz/blog/chall3ng3r/
Feel free to modify or distribute.
*/
/*
Method: FlashObject
Param1: SWF path
Param2: Movie width
Param3: Movie height
Param4: BGColor
Param5: Flashvars (Optional)
*/
function FlashObject(swf, width, height, bgcolor, id, flashvars,wm) {
var strFlashTag = new String();
if (navigator.appName.indexOf("Microsoft") != -1) {
strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
strFlashTag += '<param name="movie" value="' + swf + '"/>';
if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
strFlashTag += '<param name="quality" value="best"/>';
strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
strFlashTag += '<param name="menu" value="false"/>';
strFlashTag += '<param name="salign" value="LT"/>';
strFlashTag += '<param name="scale" value="noscale"/>';
strFlashTag += '<param name="wmode" value="' + wm + '"/>';
strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
strFlashTag += '</object>';
} else {
strFlashTag += '<embed src="' + swf + '" ';
strFlashTag += 'quality="best" ';
strFlashTag += 'bgcolor="' + bgcolor + '" ';
strFlashTag += 'width="' + width + '" ';
strFlashTag += 'height="' + height + '" ';
strFlashTag += 'menu="false" ';
strFlashTag += 'scale="noscale" ';
strFlashTag += 'id="' + id + '" ';
strFlashTag += 'salign="LT" ';
strFlashTag += 'wmode="' + wm + '" ';
strFlashTag += 'allowScriptAccess="sameDomain" ';
if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
strFlashTag += 'type="application/x-shockwave-flash" ';
strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
strFlashTag += '</embed>';
}
document.write(strFlashTag);
}
2. HTML 에 호출내용 추가
<script type="text/javascript" src="flashObj.js"></script>
<script type="text/javascript">
FlashObject("swf/Img.swf", 711, 313, "#ffffff", "swfID1", "", "transparent");
// FlashObject(swf, width, height, bgcolor, id, flashvars, wm);
// id : 고유값
// flashvars :
// wm : transparent , opaque , window
</script>
/*
IE Flash ActiveContent Activation Script
Author: Faisal Iqbal (chall3ng3r)
Blog:
Feel free to modify or distribute.
*/
/*
Method: FlashObject
Param1: SWF path
Param2: Movie width
Param3: Movie height
Param4: BGColor
Param5: Flashvars (Optional)
*/
function FlashObject(swf, width, height, bgcolor, id, flashvars,wm) {
var strFlashTag = new String();
if (navigator.appName.indexOf("Microsoft") != -1) {
strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
strFlashTag += '<param name="movie" value="' + swf + '"/>';
if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
strFlashTag += '<param name="quality" value="best"/>';
strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
strFlashTag += '<param name="menu" value="false"/>';
strFlashTag += '<param name="salign" value="LT"/>';
strFlashTag += '<param name="scale" value="noscale"/>';
strFlashTag += '<param name="wmode" value="' + wm + '"/>';
strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
strFlashTag += '</object>';
} else {
strFlashTag += '<embed src="' + swf + '" ';
strFlashTag += 'quality="best" ';
strFlashTag += 'bgcolor="' + bgcolor + '" ';
strFlashTag += 'width="' + width + '" ';
strFlashTag += 'height="' + height + '" ';
strFlashTag += 'menu="false" ';
strFlashTag += 'scale="noscale" ';
strFlashTag += 'id="' + id + '" ';
strFlashTag += 'salign="LT" ';
strFlashTag += 'wmode="' + wm + '" ';
strFlashTag += 'allowScriptAccess="sameDomain" ';
if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
strFlashTag += 'type="application/x-shockwave-flash" ';
strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
strFlashTag += '</embed>';
}
document.write(strFlashTag);
}
2. HTML 에 호출내용 추가
<script type="text/javascript" src="flashObj.js"></script>
<script type="text/javascript">
FlashObject("swf/Img.swf", 711, 313, "#ffffff", "swfID1", "", "transparent");
// FlashObject(swf, width, height, bgcolor, id, flashvars, wm);
// id : 고유값
// flashvars :
// wm : transparent , opaque , window
</script>
댓글목록
등록된 댓글이 없습니다.