[javascript] 플래시 출력 스크립트
로빈아빠
본문
function makeFlashObj(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_allowFullScreen_,_menu_){
_wmode_ = (_wmode_ == undefined)? "transparent" : _wmode_; // wmode = "window/ opaque/ transparent"
_bgColor_ = (_bgColor_ == undefined)? "#FFFFFF" : _bgColor_; // default "#000000" -> "#FFFFFF" _change 2007. 6. 14
_allowFullScreen_ = (_allowFullScreen_ == undefined)? true : _allowFullScreen_; // allowFullScreen = true / false
_menu_ = (_menu_ == undefined)? false : _menu_;
var _object_;
var arr_obj = [];
arr_obj.push('<object width="'+_width_+'" height="'+_height_+'" id="'+_flashID_+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" >');
arr_obj.push('<param name="allowscriptAccess" value="always" />');
arr_obj.push('<param name="quality" value="high" />');
arr_obj.push('<param name="menu" value="'+_menu_+'" />');
arr_obj.push('<param name="movie" value="'+_swfURL_+'" />');
arr_obj.push('<param name="wmode" value="'+_wmode_+'" />');
arr_obj.push('<param name="bgcolor" value="'+_bgColor_+'" />');
arr_obj.push('<param name="FlashVars" value="'+_flashVars_+'">');
arr_obj.push('<param name="allowFullScreen" value="'+_allowFullScreen_+'">');
arr_obj.push('<embed src="'+_swfURL_+'" quality="high" wmode="'+_wmode_+'" menu= "'+_menu_ +'" FlashVars="'+_flashVars_+'" bgcolor="'+_bgColor_+'" width="'+_width_+'" height="'+_height_+'" name="'+_flashID_+'" allowFullScreen="'+_allowFullScreen_+'" align="middle" allowscriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
arr_obj.push('</object>');
_object_ = arr_obj.join("");
return _object_;
//document.write(_object_);
}
// 1.1 version support
//showFlash("swfURLh.swf", "flashID", width, height, "transparent", flashVars, bgColor,allowFullScreen);
function showFlash(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_allowFullScreen_){
document.write(makeFlashObj(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_allowFullScreen_));
}
<script type="text/javascript">
showFlash("/loginv2/commonLoginF.swf", "flashlogin", 105, 49, "window", "null", "#f7f7f7", "false");
</script>
_wmode_ = (_wmode_ == undefined)? "transparent" : _wmode_; // wmode = "window/ opaque/ transparent"
_bgColor_ = (_bgColor_ == undefined)? "#FFFFFF" : _bgColor_; // default "#000000" -> "#FFFFFF" _change 2007. 6. 14
_allowFullScreen_ = (_allowFullScreen_ == undefined)? true : _allowFullScreen_; // allowFullScreen = true / false
_menu_ = (_menu_ == undefined)? false : _menu_;
var _object_;
var arr_obj = [];
arr_obj.push('<object width="'+_width_+'" height="'+_height_+'" id="'+_flashID_+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" >');
arr_obj.push('<param name="allowscriptAccess" value="always" />');
arr_obj.push('<param name="quality" value="high" />');
arr_obj.push('<param name="menu" value="'+_menu_+'" />');
arr_obj.push('<param name="movie" value="'+_swfURL_+'" />');
arr_obj.push('<param name="wmode" value="'+_wmode_+'" />');
arr_obj.push('<param name="bgcolor" value="'+_bgColor_+'" />');
arr_obj.push('<param name="FlashVars" value="'+_flashVars_+'">');
arr_obj.push('<param name="allowFullScreen" value="'+_allowFullScreen_+'">');
arr_obj.push('<embed src="'+_swfURL_+'" quality="high" wmode="'+_wmode_+'" menu= "'+_menu_ +'" FlashVars="'+_flashVars_+'" bgcolor="'+_bgColor_+'" width="'+_width_+'" height="'+_height_+'" name="'+_flashID_+'" allowFullScreen="'+_allowFullScreen_+'" align="middle" allowscriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
arr_obj.push('</object>');
_object_ = arr_obj.join("");
return _object_;
//document.write(_object_);
}
// 1.1 version support
//showFlash("swfURLh.swf", "flashID", width, height, "transparent", flashVars, bgColor,allowFullScreen);
function showFlash(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_allowFullScreen_){
document.write(makeFlashObj(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_allowFullScreen_));
}
<script type="text/javascript">
showFlash("/loginv2/commonLoginF.swf", "flashlogin", 105, 49, "window", "null", "#f7f7f7", "false");
</script>
관련링크
댓글목록
등록된 댓글이 없습니다.