Posts Tagged ‘Flash’

Web Developer Toolbar’s Display Object Information

Thursday, September 25th, 2008
파이어 폭스의 익스텐션 중에서 웹 디벨로퍼 툴바의 기능 중 플래시 디버깅에 유용한 기능이 있어서 소개합니다.
Information > Display Object Information 메뉴를 선택하면, 플래시 오브젝트의 태그를 화면에 디스플레이 해 줍니다. 물론 소스보기를 통해서도 확인할 수 있는 내용이지만, 원하는 부분을 쉽게 찾기 어렵죠. 게다가 자바스크립트를 통해서 입력된 경우에는 더욱 그렇고요. 위 기능을 사용하면 매우 편리합니다.
There is a useful feature in Web Developer Toolbar extension for FireFox. If Display Object Information menu is activated, Flash objects’ tags are displayed on the screen. It is useful when you debug your Flash applications.
FireFox用Web Developer Toolbarの中でデバッグする時役に立つ機能があります。Display Object Informationメーにュを実行すると、フラッシュオブゼクトのタグを示します。デバッグする時、有用なものです。


[JS] Copying flash object with FlashVars parameter.

Tuesday, April 1st, 2008

IE에서 자바스크립트를 이용하여 플래시 오브젝트를 클립보드로 복사할 때, object 객체를 선택, 복사하면 FlashVars 속성이 누락되어 복사되는 문제가 있습니다. 그러나 embed 객체를 복사하면 그런 문제가 없습니다.

그러므로 아래 코드와 같이 object 객체의 altHtml 속성을 이용하여 embed 객체를 동적으로 생성, 이 embed 객체를 복사하도록 하면 됩니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Gets Flash object.
var obj = document.getElementById("flashObjectID");
var alt = obj.altHtml; // embed tag
 
// Creates a temporary embed object in the "tempLayer" layer.
var temp = document.getElementById("tempLayer");
temp.innerHTML = alt;
 
// Selects and copies the temporary embed object to the clipboard.
var range = document.body.createTextRange();
range.moveToElementText(temp);
range.select();
range.execCommand('copy');
range.moveToPoint(0,0);
range.select();
range = null;
 
// Removes the temporary embed object.
temp.innerHTML = "";

IE에서 object 태그를 사용하지 않고 직접 embed 태그만 사용하는 경우나, 파이어폭스 등 비IE 브라우저에서는, 이럴 필요가 없이, 바로 embed 객체를 선택하여 복사해주면 되죠.