출처: http://blog.naver.com/realgoldhwan/120030539013
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| // Create a new LoadVars object
var my_lv:LoadVars = new LoadVars();
//Convert the variable string to properties
my_lv.decode(”name=Mort&score=250000″);
trace(my_lv.toString());
// Iterate over properties in my_lv
for (var prop in my_lv) {
trace(prop+” -> “+my_lv[prop]);
}
// OUTPUT
score=250000&name=Mort
score -> 250000
name -> Mort |
올플래시 사이트 개발시에 매우 유용하게 사용할 수 있는 툴입니다.
ExternalInterface와 자바스크립트를 이용하는 것으로,
브라우저의 이전 페이지, 다음 페이지, 리프래시 버튼을 사용할 수 있도록 하며,
브라우저의 제목 표시줄의 내용을 제어할 수 있도록 합니다.
샘플 보기 (Flash 버전)
SWFObject와 함께 동작하도록 만들어 진 것으로, 이미 SWFObject를 사용하고 있다면 쉽게 사용할 수 있을 것 같습니다.
지원 브라우저
- IE 6.0, 7.0
- Firefox 1.5
- Safari 2.04
- Opera 9.02
http://www.asual.com/swfaddress/
데이터그리드에서 가로 스크롤바의 표시여부는 제어할 수 있지만,
세로 스크롤바는 항상 나오도록 되어있습니다.
이걸 없애보려고 for in으로 돌려서, 데이터그리드 구조를 파악하고,
스크롤바 무비를 removeMovieClip()해보기도 했다는…
그래도 만족할 만한 효과를 얻을 수 없었죠.
그런데 DataGrid.as를 살펴보다 힌트를 얻어서 해보니 정말 어처구니 없게도…
잘 되더군요.
DataGrid.__vScrollPolicy = “off”;
물론 as파일 내에는 __vScrollPolicy 라는 녀석은 없습니다.
그런데 가로스크롤바를 제어하는 __hScrollPolicy 녀석이 있길래,
혹시나 하고 해보니 되더군요…
샘플보기 : http://www.hangunsworld.com/board/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
| /*
* getFolderPath
* 무비클립이 위치한 폴더의 경로를 절대경로로 반환하는 함수
* @mc : 폴더의 경로를 알고자하는 무비클립
* @subFolder : 타겟 폴더의 경로
*/
getFolderPath = function(mc:MovieClip, subFolder:String):String{
var url:String = mc._url;
var protocol:String;
var domain:String;
var path:String;
// set protocol
if(url.indexOf("http://") >= 0){
// web
protocol = "http://";
}else{
// local
protocol = "file:///";
}
var urls:Array = url.split(protocol);
var paths:Array = urls[1].split("/");
// set domain
domain = paths.shift().toString() + "/";
// remove filename
paths.pop();
// analyze subfolder structure
if(subFolder == undefined){
// none
subFolder = "";
}else if(subFolder.indexOf("/") == 0){
// root
paths = [];
subFolder = subFolder.slice(1);
}else if(subFolder.indexOf("../") == 0){
// parent folder
var subs:Array = subFolder.split("../");
var count:Number = subs.length-1;
for(var i:Number=0; i<count; i++){
subs.shift();
paths.pop();
}
subFolder = subs.join("/");
}else{
if(subFolder.indexOf("./") >= 0){
subFolder = subFolder.slice(2);
}
}// end if
// set path
path = paths.join("/");
// make full path
url = protocol + domain + path;
// add sub folder to full path
if(url.lastIndexOf("/") != url.length-1){
url += "/";
}// end if
url += subFolder;
// confirm if "/" is last character
if(url.lastIndexOf("/") != url.length-1){
url += "/";
}// end if
return url;
}// getFolderPath |
전에 만들었던 함수를 개선하여, 매개변수로 하위 폴더 정보를 추가할 수 있도록 수정한 버전….
getFolderPath(this);
는 물론이고
getFolderPath(this, "./subfolder");
getFolderPath(this, "sub/subfonder");
getFolderPath(this, "../../../");
getFolderPath(this, "../../subfolder");
getFolderPath(this, "/");
getFolderPath(this, "/fubfolder");
와 같이 원하는 폴더구조를 입력하여 사용할 수 있습니다.