{"id":59341,"date":"2024-10-12T21:19:14","date_gmt":"2024-10-12T13:19:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/59341\/"},"modified":"2024-10-12T21:19:14","modified_gmt":"2024-10-12T13:19:14","slug":"as3%e6%95%b8%e6%93%9a%e5%ba%ab%e6%93%8d%e4%bd%9c%e5%8f%8a%e6%87%89%e7%94%a8-as3-%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/59341\/","title":{"rendered":"AS3\u6578\u64da\u5eab\u64cd\u4f5c\u53ca\u61c9\u7528 (as3 \u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"as3%e6%95%b8%e6%93%9a%e5%ba%ab%e6%93%8d%e4%bd%9c%e5%8f%8a%e6%87%89%e7%94%a8-ekuGINmPYv\">AS3\u6578\u64da\u5eab\u64cd\u4f5c\u53ca\u61c9\u7528<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u64cd\u4f5c\u8207\u61c9\u7528\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002Adobe Flash\u7684ActionScript 3\uff08AS3\uff09\u4f5c\u70ba\u4e00\u7a2e\u5f37\u5927\u7684\u7de8\u7a0b\u8a9e\u8a00\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u65b9\u6cd5\u4f86\u8207\u6578\u64da\u5eab\u9032\u884c\u4ea4\u4e92\u3002\u672c\u6587\u5c07\u63a2\u8a0eAS3\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u57fa\u672c\u6982\u5ff5\u3001\u5e38\u7528\u6280\u8853\u4ee5\u53ca\u5be6\u969b\u61c9\u7528\u6848\u4f8b\u3002<\/p>\n<h2 id=\"as3%e8%88%87%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e9%97%9c%e4%bf%82-ekuGINmPYv\">AS3\u8207\u6578\u64da\u5eab\u7684\u95dc\u4fc2<\/h2>\n<p>AS3\u4e3b\u8981\u7528\u65bc\u958b\u767c\u4e92\u52d5\u5f0f\u7db2\u9801\u61c9\u7528\u548c\u904a\u6232\uff0c\u7136\u800c\uff0c\u96a8\u8457Web 2.0\u7684\u8208\u8d77\uff0c\u6578\u64da\u7684\u5b58\u5132\u548c\u7ba1\u7406\u9700\u6c42\u4e5f\u96a8\u4e4b\u589e\u52a0\u3002AS3\u53ef\u4ee5\u901a\u904e\u591a\u7a2e\u65b9\u5f0f\u8207\u6578\u64da\u5eab\u9032\u884c\u4ea4\u4e92\uff0c\u6700\u5e38\u898b\u7684\u65b9\u5f0f\u662f\u4f7f\u7528HTTP\u8acb\u6c42\u4f86\u8abf\u7528\u5f8c\u7aef\u670d\u52d9\uff0c\u9019\u4e9b\u670d\u52d9\u901a\u5e38\u662f\u7528PHP\u3001Node.js\u7b49\u8a9e\u8a00\u7de8\u5beb\u7684\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e6%93%8d%e4%bd%9c%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%b5%81%e7%a8%8b-ekuGINmPYv\">\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u57fa\u672c\u6d41\u7a0b<\/h2>\n<p>\u5728AS3\u4e2d\uff0c\u6578\u64da\u5eab\u64cd\u4f5c\u901a\u5e38\u6d89\u53ca\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<ul>\n<li><strong>\u5efa\u7acb\u9023\u63a5\uff1a<\/strong>\u4f7f\u7528URLLoader\u985e\u4f86\u767c\u9001HTTP\u8acb\u6c42\u3002<\/li>\n<li><strong>\u767c\u9001\u8acb\u6c42\uff1a<\/strong>\u901a\u904ePOST\u6216GET\u65b9\u6cd5\u5c07\u6578\u64da\u767c\u9001\u5230\u4f3a\u670d\u5668\u3002<\/li>\n<li><strong>\u63a5\u6536\u97ff\u61c9\uff1a<\/strong>\u8655\u7406\u4f3a\u670d\u5668\u8fd4\u56de\u7684\u6578\u64da\uff0c\u901a\u5e38\u662fJSON\u6216XML\u683c\u5f0f\u3002<\/li>\n<li><strong>\u6578\u64da\u8655\u7406\uff1a<\/strong>\u6839\u64da\u9700\u8981\u5c0d\u63a5\u6536\u5230\u7684\u6578\u64da\u9032\u884c\u89e3\u6790\u548c\u986f\u793a\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%a4%ba%e4%be%8b%e4%bb%a3%e7%a2%bc-ekuGINmPYv\">\u793a\u4f8b\u4ee3\u78bc<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684AS3\u4ee3\u78bc\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u901a\u904eHTTP\u8acb\u6c42\u8207\u5f8c\u7aef\u6578\u64da\u5eab\u9032\u884c\u4ea4\u4e92\uff1a<\/p>\n<pre><code>\nvar url:String = \"http:\/\/yourserver.com\/api\/getData.php\";\nvar urlLoader:URLLoader = new URLLoader();\nvar urlRequest:URLRequest = new URLRequest(url);\nurlRequest.method = URLRequestMethod.POST;\n\nurlLoader.addEventListener(Event.COMPLETE, onDataLoad);\nurlLoader.addEventListener(IOErrorEvent.IO_ERROR, onError);\n\nurlLoader.load(urlRequest);\n\nfunction onDataLoad(event:Event):void {\n    var data:Object = JSON.parse(event.target.data);\n    trace(\"Received data: \" + data);\n}\n\nfunction onError(event:IOErrorEvent):void {\n    trace(\"Error loading data: \" + event.text);\n}\n<\/code><\/pre>\n<h2 id=\"as3%e6%95%b8%e6%93%9a%e5%ba%ab%e6%87%89%e7%94%a8%e6%a1%88%e4%be%8b-ekuGINmPYv\">AS3\u6578\u64da\u5eab\u61c9\u7528\u6848\u4f8b<\/h2>\n<p>AS3\u5728\u6578\u64da\u5eab\u64cd\u4f5c\u4e2d\u7684\u61c9\u7528\u7bc4\u570d\u5ee3\u6cdb\uff0c\u4ee5\u4e0b\u662f\u5e7e\u500b\u5e38\u898b\u7684\u61c9\u7528\u6848\u4f8b\uff1a<\/p>\n<ul>\n<li><strong>\u5728\u7dda\u904a\u6232\uff1a<\/strong>\u8a31\u591a\u5728\u7dda\u904a\u6232\u4f7f\u7528AS3\u4f86\u5b58\u5132\u73a9\u5bb6\u7684\u6578\u64da\uff0c\u5982\u5206\u6578\u3001\u6210\u5c31\u7b49\uff0c\u4e26\u901a\u904e\u6578\u64da\u5eab\u9032\u884c\u7ba1\u7406\u3002<\/li>\n<li><strong>\u793e\u4ea4\u5a92\u9ad4\u61c9\u7528\uff1a<\/strong>AS3\u53ef\u4ee5\u7528\u65bc\u958b\u767c\u793e\u4ea4\u5a92\u9ad4\u5e73\u53f0\uff0c\u901a\u904e\u6578\u64da\u5eab\u5b58\u5132\u7528\u6236\u4fe1\u606f\u548c\u5e16\u5b50\u5167\u5bb9\u3002<\/li>\n<li><strong>\u96fb\u5b50\u5546\u52d9\u7db2\u7ad9\uff1a<\/strong>\u5728\u96fb\u5b50\u5546\u52d9\u5e73\u53f0\u4e2d\uff0cAS3\u53ef\u4ee5\u7528\u4f86\u8655\u7406\u5546\u54c1\u4fe1\u606f\u3001\u8a02\u55ae\u548c\u7528\u6236\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-ekuGINmPYv\">\u7d50\u8ad6<\/h2>\n<p>AS3\u4f5c\u70ba\u4e00\u7a2e\u9748\u6d3b\u7684\u7de8\u7a0b\u8a9e\u8a00\uff0c\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u4e86\u591a\u7a2e\u8207\u6578\u64da\u5eab\u4ea4\u4e92\u7684\u65b9\u5f0f\u3002\u901a\u904eHTTP\u8acb\u6c42\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u8f15\u9b06\u5730\u5c07\u6578\u64da\u5b58\u5132\u5230\u4f3a\u670d\u5668\uff0c\u4e26\u5f9e\u4e2d\u6aa2\u7d22\u6578\u64da\u3002\u96a8\u8457\u6280\u8853\u7684\u9032\u6b65\uff0cAS3\u5728\u6578\u64da\u5eab\u64cd\u4f5c\u4e2d\u7684\u61c9\u7528\u5c07\u6703\u66f4\u52a0\u5ee3\u6cdb\uff0c\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u66f4\u591a\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u5982\u4f55\u5728\u9999\u6e2f\u4f7f\u7528<a href=\"https:\/\/server.hk\">VPS<\/a>\u4f86\u652f\u6301\u60a8\u7684AS3\u61c9\u7528\u6709\u8208\u8da3\uff0c\u8acb\u96a8\u6642\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22AS3\u6578\u64da\u5eab\u64cd\u4f5c\u53ca\u61c9\u7528\uff0c\u5b78\u7fd2\u5982\u4f55\u6709\u6548\u7ba1\u7406\u6578\u64da\uff0c\u63d0\u5347\u61c9\u7528\u6027\u80fd\uff0c\u5be6\u73fe\u66f4\u4f73\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-59341","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=59341"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59341\/revisions"}],"predecessor-version":[{"id":59342,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59341\/revisions\/59342"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=59341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=59341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=59341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}