{"id":51,"date":"2006-10-20T17:13:30","date_gmt":"2006-10-20T08:13:30","guid":{"rendered":"http:\/\/www.hangunsworld.com\/blog\/?p=51"},"modified":"2008-01-02T23:47:51","modified_gmt":"2008-01-02T14:47:51","slug":"as-swf%ea%b0%80-%ec%9c%84%ec%b9%98%ed%95%9c-%ed%8f%b4%eb%8d%94-%ea%b2%bd%eb%a1%9c-%eb%b0%98%ed%99%98-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"http:\/\/hangunsworld.com\/blog\/51","title":{"rendered":"[AS] SWF\uac00 \uc704\uce58\ud55c \ud3f4\ub354 \uacbd\ub85c \ubc18\ud658 \ud568\uc218"},"content":{"rendered":"<pre lang=\"ActionScript\" line=\"1\">\/*\r\n* getFolderPath\r\n* \ubb34\ube44\ud074\ub9bd\uc774 \uc704\uce58\ud55c \ud3f4\ub354\uc758 \uacbd\ub85c\ub97c \uc808\ub300\uacbd\ub85c\ub85c \ubc18\ud658\ud558\ub294 \ud568\uc218\r\n* @mc : \ud3f4\ub354\uc758 \uacbd\ub85c\ub97c \uc54c\uace0\uc790\ud558\ub294 \ubb34\ube44\ud074\ub9bd\r\n* @subFolder : \ud0c0\uac9f \ud3f4\ub354\uc758 \uacbd\ub85c\r\n*\/\r\ngetFolderPath = function(mc:MovieClip, subFolder:String):String{\r\n        var url:String = mc._url;\r\n\r\n        var protocol:String;\r\n        var domain:String;\r\n        var path:String;\r\n\r\n        \/\/ set protocol\r\n        if(url.indexOf(\"http:\/\/\") >= 0){\r\n                \/\/ web\r\n                protocol = \"http:\/\/\";\r\n        }else{\r\n                \/\/ local\r\n                protocol = \"file:\/\/\/\";\r\n        }\r\n\r\n        var urls:Array = url.split(protocol);\r\n        var paths:Array = urls[1].split(\"\/\");\r\n\r\n        \/\/ set domain\r\n        domain = paths.shift().toString() + \"\/\";\r\n\r\n        \/\/ remove filename\r\n        paths.pop();\r\n\r\n        \/\/ analyze subfolder structure\r\n        if(subFolder == undefined){\r\n                \/\/ none\r\n                subFolder = \"\";\r\n\r\n        }else if(subFolder.indexOf(\"\/\") == 0){\r\n                \/\/ root\r\n                paths = [];\r\n                subFolder = subFolder.slice(1);\r\n\r\n        }else if(subFolder.indexOf(\"..\/\") == 0){\r\n                \/\/ parent folder\r\n                var subs:Array = subFolder.split(\"..\/\");\r\n                var count:Number = subs.length-1;\r\n                for(var i:Number=0; i<count; i++){\r\n                        subs.shift();\r\n                        paths.pop();\r\n                }\r\n                subFolder = subs.join(\"\/\");\r\n        }else{\r\n                if(subFolder.indexOf(\".\/\") >= 0){\r\n                        subFolder = subFolder.slice(2);\r\n                }\r\n        }\/\/ end if\r\n\r\n        \/\/ set path\r\n        path = paths.join(\"\/\");\r\n\r\n        \/\/ make full path\r\n        url = protocol + domain + path;\r\n\r\n        \/\/ add sub folder to full path\r\n        if(url.lastIndexOf(\"\/\") != url.length-1){\r\n                url += \"\/\";\r\n        }\/\/ end if\r\n        url += subFolder;\r\n\r\n        \/\/ confirm if \"\/\" is last character\r\n        if(url.lastIndexOf(\"\/\") != url.length-1){\r\n                url += \"\/\";\r\n        }\/\/ end if\r\n\r\n        return url;\r\n}\/\/ getFolderPath<\/pre>\n<p>\uc804\uc5d0 \ub9cc\ub4e4\uc5c8\ub358 \ud568\uc218\ub97c \uac1c\uc120\ud558\uc5ec, \ub9e4\uac1c\ubcc0\uc218\ub85c \ud558\uc704 \ud3f4\ub354 \uc815\ubcf4\ub97c \ucd94\uac00\ud560 \uc218 \uc788\ub3c4\ub85d \uc218\uc815\ud55c \ubc84\uc804&#8230;.<\/p>\n<p>getFolderPath(this);<br \/>\n\ub294 \ubb3c\ub860\uc774\uace0<br \/>\ngetFolderPath(this, &quot;.\/subfolder&quot;);<br \/>\ngetFolderPath(this, &quot;sub\/subfonder&quot;);<br \/>\ngetFolderPath(this, &quot;..\/..\/..\/&quot;);<br \/>\ngetFolderPath(this, &quot;..\/..\/subfolder&quot;);<br \/>\ngetFolderPath(this, &quot;\/&quot;);<br \/>\ngetFolderPath(this, &quot;\/fubfolder&quot;);<br \/>\n\uc640 \uac19\uc774 \uc6d0\ud558\ub294 \ud3f4\ub354\uad6c\uc870\ub97c \uc785\ub825\ud558\uc5ec \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* * getFolderPath * \ubb34\ube44\ud074\ub9bd\uc774 \uc704\uce58\ud55c \ud3f4\ub354\uc758 \uacbd\ub85c\ub97c \uc808\ub300\uacbd\ub85c\ub85c \ubc18\ud658\ud558\ub294 \ud568\uc218 * @mc : \ud3f4\ub354\uc758 \uacbd\ub85c\ub97c \uc54c\uace0\uc790\ud558\ub294 \ubb34\ube44\ud074\ub9bd * @subFolder : \ud0c0\uac9f \ud3f4\ub354\uc758 \uacbd\ub85c *\/ 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(&#8220;http:\/\/&#8221;) >= 0){ \/\/ web protocol = &#8220;http:\/\/&#8221;; }else{ \/\/ local protocol = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-actionscript2"],"_links":{"self":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}