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 객체를 선택하여 복사해주면 되죠.

 
You can pass data from an HTML document to a Flash movie via FlashVars or query string.
In AS2, these data are defined as variables in the main timeline(_root). But you have to access the data using loaderInfo.parameters in AS3.
HTML문서에서 FlashVars 또는 쿼리 스트링을 사용하여 플래시 무비로 데이터를 전달할 수 있습니다.
AS2에서는, 이렇게 넘어온 데이터가 메인 타임라인(_root) 상의 변수로 만들어집니다. 그러나 AS3에서는, loaderInfo.parameters를 통하여 접근하게 됩니다.
FlashVarsおよびquery stringを使ってHTMLドキュメントからFlashム―ビ―にデ―タを伝える事が出来ます。
AS2では、そのデーターがメーンのタイムライン(_root)の変数に作られます。しかし、AS3ではloaderInfo.parametersを使う事になりました。
1
2
var userID:String = loaderInfo.parameters.userID;
var pathXML:String = loaderInfo.parameters.pathXML;
© 2011 Hangun's World - Blog Suffusion theme by Sayontan Sinha