이미지 등을 플래시로 직접 로드하지 않고 브라우저의 캐쉬로 로드하여, 필요할 때 빨리 로드가 가능하도록 해주는 클래스입니다.

LoadVars를 이용한 트릭을 사용했다고 하네요.

Preloading Files into the Browser’s Cache

 

출처: 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
 

데이터그리드에서 가로 스크롤바의 표시여부는 제어할 수 있지만,
세로 스크롤바는 항상 나오도록 되어있습니다.

이걸 없애보려고 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");
와 같이 원하는 폴더구조를 입력하여 사용할 수 있습니다.

 

투명한 팝업창 뒤의 배경에 블러를 적용한 예제와 소스를 공개했네요.

비트맵 데이터와 블러필터를 이용한 것으로,
배경 무비를 비트맵 데이터로 복제한 다음 블러를 적용한 듯 합니다.

Pixelfumes Flash Blog

© 2011 Hangun's World - Blog Suffusion theme by Sayontan Sinha