{"id":386,"date":"2008-09-25T20:04:12","date_gmt":"2008-09-25T11:04:12","guid":{"rendered":"http:\/\/hangunsworld.com\/blog\/?p=386"},"modified":"2008-10-15T22:59:11","modified_gmt":"2008-10-15T13:59:11","slug":"retrieving-the-url","status":"publish","type":"post","link":"http:\/\/hangunsworld.com\/blog\/386","title":{"rendered":"Retrieving the URL."},"content":{"rendered":"<div class=\"korean\">\ud50c\ub798\uc2dc \ubb34\ube44\uc5d0\uc11c \ud574\ub2f9 SWF \ud30c\uc77c\uc744 \ud3ec\ud568\ud558\ub294 HTML \ubb38\uc11c\uc758 URL\uc744 \uad6c\ud558\ub824\uba74, HTML \ubb38\uc11c\uc5d0\uc11c \uc124\uc815\uc744 \ud574\uc8fc\uc5b4\uc57c \ud569\ub2c8\ub2e4. FlashVars \ud30c\ub77c\uba54\ud130 \ub610\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub97c \ud1b5\ud574\uc11c \ud50c\ub798\uc2dc \ubb34\ube44\ub85c URL\uc744 \uc804\ub2ec\ud574 \uc918\uc57c \ud558\uc8e0. \uadf8\ub7f0\ub370 \ud50c\ub798\uc2dc\uc758 ExternalInterface API\uc640 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 eval() \ud568\uc218\ub97c \uc774\uc6a9\ud558\uba74, \uadf8\ub7f4 \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.<\/div>\n<div class=\"english\">To retrieve the HTML document&#8217;s URL in which the SWF file is inserted, you have to modify the HTML document. Pass the URL to the SWF movie via an FlashVars parameter or a JavaScript function. But, the ExternalInterface API in Flash and eval() function in JavaScript provide you with a more simple solution.<\/div>\n<div class=\"japanese\">SWF\u30d5\u30a1\u30a4\u30eb\u304c\u542b\u307e\u308c\u3066\u3044\u308bHTML\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306eURL\u3092\u5f97\u308b\u305f\u3081\u306b\u306f\u3001\u305d\u306eHTML\u30d5\u30a1\u30a4\u30eb\u306b\u4f55\u304b\u8a2d\u5b9a\u3092\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002FlashVars\u30d1\u30e9\u30e1\u30bf\u3068\u304bJavaScript\u3092\u4f7f\u3063\u3066\u30d5\u30e9\u30c3\u30b7\u30e5\u30e0\u30fc\u30d3\u30fc\u306bURL\u3092\u4f1d\u9054\u3057\u307e\u3059\u3002\u3067\u3082\u3001\u30d5\u30e9\u30c3\u30b7\u30e5\u306eExternalInterface API\u3068\u5171\u306bJavaScript\u306eeval()\u51fd\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u305d\u306e\u5fc5\u8981\u306f\u306a\u3044\u3093\u3067\u3059\u3002<\/div>\n<p><script type=\"text\/javascript\">\ninsertFlashObject('http:\/\/hangunsworld.com\/blog\/wp-content\/uploads\/2008\/09\/javascript_eval.swf', 400, 150);\n<\/script><\/p>\n<pre lang=\"actionscript3\" line=\"1\">var btn:Button;\r\nfor(var i:uint=1; i<=3; i++){\r\n\tbtn = this[\"b\" + i];\r\n\tbtn.addEventListener(MouseEvent.CLICK, clickListener);\r\n}\r\n\r\nfunction clickListener(e:MouseEvent):void{\r\n\tbtn = e.currentTarget as Button;\r\n\tvar str:String = ExternalInterface.call(\"eval\", btn.label);\r\n\ttf.text = str;\r\n}<\/pre>\n<p>Related link: <a href=\"http:\/\/wooyaggo.tistory.com\/163\">http:\/\/wooyaggo.tistory.com\/163<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud50c\ub798\uc2dc \ubb34\ube44\uc5d0\uc11c \ud574\ub2f9 SWF \ud30c\uc77c\uc744 \ud3ec\ud568\ud558\ub294 HTML \ubb38\uc11c\uc758 URL\uc744 \uad6c\ud558\ub824\uba74, HTML \ubb38\uc11c\uc5d0\uc11c \uc124\uc815\uc744 \ud574\uc8fc\uc5b4\uc57c \ud569\ub2c8\ub2e4. FlashVars \ud30c\ub77c\uba54\ud130 \ub610\ub294 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\ub97c \ud1b5\ud574\uc11c \ud50c\ub798\uc2dc \ubb34\ube44\ub85c URL\uc744 \uc804\ub2ec\ud574 \uc918\uc57c \ud558\uc8e0. \uadf8\ub7f0\ub370 \ud50c\ub798\uc2dc\uc758 ExternalInterface API\uc640 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc758 eval() \ud568\uc218\ub97c \uc774\uc6a9\ud558\uba74, \uadf8\ub7f4 \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4. To retrieve the HTML document&#8217;s URL in which the SWF file is inserted, you have to modify the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[139,151,150,555],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-as3","tag-actionscript-30","tag-eval","tag-externalinterface","tag-javascript"],"_links":{"self":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/posts\/386","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=386"}],"version-history":[{"count":0,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"wp:attachment":[{"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hangunsworld.com\/blog\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}