또 다른 플래시출력 태그입니다. 링크까지 걸기. > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

또 다른 플래시출력 태그입니다. 링크까지 걸기. 정보

또 다른 플래시출력 태그입니다. 링크까지 걸기.

본문

우선 js 파일 만듭니다.
예를 들어서 js파일을 123.js 라고 한경로에 만들었습니다.
123.js 파일 안에 들어갈 소스는 아래와 같습니다.

function cf(flashsrc,flashwidth,flashheight,flashlink,br){
document.write("<table width="+flashwidth+" height="+flashheight+" border=0 cellpadding=0 cellspacing=0><tr><td>");
document.write("<div style=\"position:relative\">");
document.write("<embed style=\"position:absolute;z-index:0\" src="+flashsrc+" quality=\"high\" width="+flashwidth+" height="+flashheight+" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" wmode=\"opaque\"></embed>");
document.write("<div style=\"position:relative;filter:alpha(opacity=0);-moz-opacity:0;z-index:10;left:0;top:0;background:transparent !important;background:#cdeaf6;width:"+flashwidth+";height:"+flashheight+"px;\">");
document.write("<a href="+flashlink+" target=\"_blank\" style=\"cursor:pointer;display:block;width:"+flashwidth+";height:"+flashheight+"px;\"></a>");
document.write("</div>");
document.write("</div>");
document.write("</td></tr></table>");
if (br=="1") {
document.write("<br>");
}
}

function cf1(flashsrc,flashwidth,flashheight,br){
document.write("<embed src=\""+flashsrc+"\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+flashwidth+" height="+flashheight+" align=center></embed>");
if (br=="1") {
document.write("<br><br>");
}
}

여기까지 js에 삽입하고 아래에는 출력방법입니다.

<SCRIPT src="123.js"></SCRIPT>

<SCRIPT>if (typeof(cf)=="function") {cf("플래시주소","너비","높이","링크주소","0");}</SCRIPT>

제가 너비 500에 높이 300으로 된 플래시를 네이버로 링크 겁니다. 그렇다면 소스삽입한다면 아래처럼 합니다.

<SCRIPT src="123.js"></SCRIPT>

<SCRIPT>if (typeof(cf)=="function") {cf("test.swf","500","300","http://www.naver.com","0");}</SCRIPT>
이렇게 하는거죠. 현재 소스는 그냥 링크가 새창으로 되는데 새창으로 않하시려면
123.js 파일에서 수정하세요.
document.write("<a href="+flashlink+" target=\"_blank\" style=\"cursor:pointer;display:block;width:"+flashwidth+";height:"+flashheight+"px;\"></a>");
이렇게 된것을
document.write("<a href="+flashlink+" style=\"cursor:pointer;display:block;width:"+flashwidth+";height:"+flashheight+"px;\"></a>");
이라고 수정하면 됩니다.
링크가 필요하지 않다면 금방 링크부분 소스를 지우시면 됩니다.
본 플래시출력은 다른 플래시출력과 달리 플래시에 마우스 오른쪽버튼을 이용해보세요. 플래시처럼 생성하지 않을거에요.
잘 이용해주시면 고맙겠습니다.
추천
3

댓글 1개

전체 3,309 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT