{"id":1668,"date":"2011-11-04T01:29:19","date_gmt":"2011-11-03T16:29:19","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=1668"},"modified":"2012-02-10T01:32:40","modified_gmt":"2012-02-09T16:32:40","slug":"actiinscript2-0-%e7%b8%a6%e6%a8%aa%e7%a7%bb%e5%8b%95-%e3%83%9c%e3%83%bc%e3%83%ab%e3%82%92%e6%8e%b4%e3%82%93%e3%81%a7%e6%8a%95%e3%81%92%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=1668","title":{"rendered":"ActiinScript2.0 \u7e26\u6a2a\u79fb\u52d5 \u30dc\u30fc\u30eb\u3092\u63b4\u3093\u3067\u6295\u3052\u308b"},"content":{"rendered":"<p>\u524d\u56de\u306e\u300c<a href=\"https:\/\/www.webcyou.com\/?p=1655\">ActiinScript2.0 \u7e26\u6a2a\u79fb\u52d5 \u30dc\u30fc\u30eb\u3092\u63b4\u3080<\/a>\u300d\u306e\u7d9a\u304d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u524d\u56de\u3067\u306f\u30dc\u30fc\u30eb\u304c\u7e26\u6a2a\u79fb\u52d5\u3057\u30c9\u30e9\u30c3\u30b0\u3067\u3064\u304b\u3080\u4e8b\u304c\u3067\u304d\u3001\u96e2\u3059\u3068\u307e\u305f\u7e26\u6a2a\u79fb\u52d5\u304c\u958b\u59cb\u3059\u308b\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u3068\u3044\u3046\u5185\u5bb9\u3067\u3057\u305f\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u3067\u3082\u4eca\u306e\u307e\u307e\u3067\u306f\u300c\u6295\u3052\u305f\u300d\u3068\u3044\u3046\u611f\u3058\u304c\u3057\u306a\u3044\u306e\u3067\u3001<\/p>\n<p style=\"margin-top: 1em;\">\u3053\u308c\u306b\u66f4\u306b\u300c\u6295\u3052\u308b\u300d\u3068\u3044\u3046\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u3067\u306f\u3001\u6295\u3052\u305f\u3068\u304d\u306e\u30b9\u30d4\u30fc\u30c9\u3084\u65b9\u5411\u306e\u8a08\u7b97\u5f0f\u306a\u3093\u3067\u3059\u304c\u3001\u3069\u3046\u8a08\u7b97\u3059\u308b\u304b\u3068\u3044\u3046\u3068<\/p>\n<p style=\"margin-top: 1em;\">\u30dc\u30fc\u30eb\u3092\u96e2\u3057\u305f\u6642\u306e\u4f4d\u7f6e\u3068\u3001\u305d\u306e\u76f4\u524d\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u7c21\u5358\u306b\u6a2a\u65b9\u5411\u306e\u307f\u3092\u8003\u3048\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u30dc\u30fc\u30eb\u3092\u96e2\u3057\u305f\u4f4d\u7f6e\u3092x2\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u76f4\u524d\u306e\u4f4d\u7f6e\u3092x1\u3068\u3059\u308b\u3068\u3001<\/p>\n<p style=\"margin-top: 1em;\">x\u65b9\u5411\u306e\u30b9\u30d4\u30fc\u30c9\u306fx2-x1\u3067\u6c42\u3081\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u30dc\u30fc\u30eb\u3092\u96e2\u3057\u305f\u3068\u304d\u306e\u4f4d\u7f6ex2\u306f\u30dc\u30fc\u30eb\u306e\u4f4d\u7f6e\u306a\u306e\u3067\u5b89\u6613\u306b\u6c42\u3081\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002\u304c\u3001<\/p>\n<p style=\"margin-top: 1em;\">\u305d\u306e\u76f4\u524d\u306e\u4f4d\u7f6e\u306f\uff1f\u3068\u306a\u308a\u307e\u3059\u3088\u306d\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001\u76f4\u524d\u306e\u4f4d\u7f6ex1\u306bx2\u306e\u5024\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u8a18\u8ff0\u3059\u308b\u3068\u3001<\/p>\n<p style=\"margin-top: 1em;\"><strong>ActionScript2.0<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">x1 = x2;\r\nx2 = this._x;\r\nspeedX = (x2-x1);<\/pre>\n<p style=\"margin-top: 1em;\">\u00a0<\/p>\n<p style=\"margin-top: 1em;\">\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3048\uff1f\u306a\u3093\u3067\uff1f\u3068\u306a\u308a\u307e\u3059\u3051\u3069\u3001onClipEvent(enterFrame){\u301c \u5185\u306b\u8a18\u8ff0\u3059\u308b\u306e\u3067<\/p>\n<p style=\"margin-top: 1em;\">\u7e70\u308a\u8fd4\u3057\u8a08\u7b97\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u8003\u3048\u308b\u3068\u3001<\/p>\n<p style=\"margin-top: 1em;\">x1\u306b\u306f\u524d\u56de\u8a08\u7b97\u3057\u305f\u6570\u5024\u304c\u4ee3\u5165\u3055\u308c\u3001x2\u306b\u306f\u4eca\u306e\u5024\u304c\u4ee3\u5165\u3055\u308c\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">3\u884c\u76ee\u306ex2-x1\u3067\u305d\u306e\u5dee\u5206\u3092\u6c42\u3081speedX\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u540c\u69d8\u306by\u5ea7\u6a19\u306e\u8a08\u7b97\u5f0f\u3092\u52a0\u3048\u308b\u3068\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\"><strong>ActionScript2.0<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">x1 = x2;\r\ny1 = y2;\r\nx2 = this._x;\r\ny2 = this._y;\r\nspeedX = (x2-x1);\r\nspeedY = (y2-y1);\r\n<\/pre>\n<p style=\"margin-top: 1em;\">\u00a0<\/p>\n<p style=\"margin-top: 1em;\">\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a08\u7b97\u306f\u30c9\u30e9\u30c3\u30b0\u3055\u308c\u3066\u3044\u308b\u3068\u304d\u306e\u8a08\u7b97\u306a\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u3001<br \/>\n if(ballHold == 1){ \u301c\u5185\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\"><strong>ActionScript2.0<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">onClipEvent(enterFrame){\r\nif(ballHold == 1){\r\nx1 = x2;\r\ny1 = y2;\r\nx2 = this._x;\r\ny2 = this._y;\r\nspeedX = (x2-x1);\r\nspeedY = (y2-y1);\r\ntrace(x1);\r\ntrace(x2);\r\n}else{\r\nif (this._x&gt;500-this._width\/2){\r\nspeedX = speedX*-1;\r\n}\r\nif (this._x&lt;0+this._width\/2) {\r\nspeedX = speedX*-1;\r\n}\r\nif (this._y&gt;400-this._width\/2) {\r\nspeedY = speedY*-1;\r\n}\r\nif (this._y&lt;0+this._width\/2) {\r\nspeedY = speedY*-1;\r\n}\r\nthis._x += speedX;\r\nthis._y += speedY;\r\n}\r\n}\r\n<\/pre>\n<\/p>\n<p style=\"margin-top: 1em;\">\u00a0<\/p>\n<p style=\"margin-top: 1em;\">\u3053\u308c\u3067\u3001\u305d\u308c\u306a\u308a\u306b\u6295\u3052\u3066\u3044\u308b\u611f\u3058\u304c\u3057\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u3067\u3082\u3001\u5f37\u304f\u6295\u3052\u3059\u304e\u308b\u3068\u67a0\u5916\u306b\u51fa\u3066\u623b\u3063\u3066\u3053\u306a\u3044\u3002\u3068\u3044\u3046\u73fe\u8c61\u304c\u8d77\u304d\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\">\u56de\u907f\u7b56\u3068\u3057\u3066\u67a0\u5916\u3092\u8d85\u3048\u305f\u5834\u5408\u306f\u67a0\u5185\u306b\u5f37\u5236\u7684\u306b\u623b\u308b\u5f0f\u3092\u52a0\u3048\u307e\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\"><strong>\u53f3<\/strong><\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">this._x = 500-this._width\/2;<\/pre>\n<\/p>\n<p style=\"margin-top: 1em;\"><strong>\u5de6<\/strong><\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">this._x = 0+this._width\/2;<\/pre>\n<\/p>\n<p style=\"margin-top: 1em;\"><strong>\u4e0a<\/strong><\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">this._y = 400-this._width\/2;<\/pre>\n<\/p>\n<p style=\"margin-top: 1em;\"><strong>\u4e0b<\/strong><\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">this._y = 0+this._width\/2;<\/pre>\n<\/p>\n<p style=\"margin-top: 2em;\">\u3053\u308c\u3092\u4ed8\u3051\u52a0\u3048\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><pre class=\"brush: plain; title: ; notranslate\" title=\"\">onClipEvent(load){\r\nspeedX = 10;\r\nspeedY = 8;\r\nballHold = 0;\r\n}\r\nonClipEvent(enterFrame){\r\nif(ballHold == 1){\r\nx1 = x2;\r\ny1 = y2;\r\nx2 = this._x;\r\ny2 = this._y;\r\nspeedX = (x2-x1);\r\nspeedY = (y2-y1);\r\n}else{\r\nif (this._x&gt;500-this._width\/2){\r\nthis._x = 500-this._width\/2;\r\nspeedX = speedX*-1;\r\n}\r\nif (this._x&lt;0+this._width\/2) {\r\nthis._x = 0+this._width\/2;\r\nspeedX = speedX*-1;\r\n}\r\nif (this._y&gt;400-this._width\/2) {\r\nthis._y = 400-this._width\/2;\r\nspeedY = speedY*-1;\r\n}\r\nif (this._y&lt;0+this._width\/2) {\r\nthis._y = 0+this._width\/2;\r\nspeedY = speedY*-1;\r\n}\r\nthis._x += speedX;\r\nthis._y += speedY;\r\n}\r\n}\r\non (press) {\r\nballHold = 1;\r\nstartDrag(this, true);\r\n}\r\non (release) {\r\nballHold = 0;\r\nstopDrag();\r\n}<\/pre>\n<\/p>\n<p style=\"margin-top: 1em;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/296a5a2b2104ec9cbe7b6f076501031d.png\" alt=\"\" title=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2011-11-04 1.36.28\" width=\"235\" height=\"149\" \/><\/p>\n<p style=\"margin-top: 1em;\"><strong>\u30c7\u30e2\u30da\u30fc\u30b8<\/strong><br \/>\n <a href=\"http:\/\/webcyou.com\/demo\/flash\/ball.html#no04\" target=\"_blank\"> \u30c7\u30e2\u30da\u30fc\u30b8\u306f\u3053\u3061\u3089\u304b\u3089\u00a0<\/a><\/p>\n<p style=\"margin-top: 1em;\">\u00a0<\/p>\n<p style=\"margin-top: 1em;\">\u6700\u5f8c\u306b\u3001\u3088\u308a\u30dc\u30fc\u30eb\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u8fd1\u3065\u3051\u308b\u305f\u3081\u3001\u91cd\u529b\u3001\u6469\u64e6\u3001\u8df3\u306d\u8fd4\u308a\u4fc2\u6570\u3092\u4ed8\u3051\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3><a href=\"https:\/\/www.webcyou.com\/?p=1676\">ActiinScript2.0 \u30dc\u30fc\u30eb\u30a2\u30af\u30b7\u30e7\u30f3 \u91cd\u529b\u3001\u6469\u64e6\u3001\u8df3\u306d\u8fd4\u308a\u4fc2\u6570<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u300cActiinScript2.0 \u7e26\u6a2a\u79fb\u52d5 \u30dc\u30fc\u30eb\u3092\u63b4\u3080\u300d\u306e\u7d9a\u304d\u3068\u306a\u308a\u307e\u3059\u3002 \u524d\u56de\u3067\u306f\u30dc\u30fc\u30eb\u304c\u7e26\u6a2a\u79fb\u52d5\u3057\u30c9\u30e9\u30c3\u30b0\u3067\u3064\u304b\u3080\u4e8b\u304c\u3067\u304d\u3001\u96e2\u3059\u3068\u307e\u305f\u7e26\u6a2a\u79fb\u52d5\u304c\u958b\u59cb\u3059\u308b\u3002 \u3068\u3044\u3046\u5185\u5bb9\u3067\u3057\u305f\u3002 \u3067\u3082\u4eca\u306e\u307e\u307e\u3067\u306f\u300c\u6295\u3052\u305f\u300d\u3068\u3044\u3046 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[172,170],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/1668"}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1668"}],"version-history":[{"count":11,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/1668\/revisions"}],"predecessor-version":[{"id":1694,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/1668\/revisions\/1694"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}