{"id":509,"date":"2010-04-24T07:18:28","date_gmt":"2010-04-24T14:18:28","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=2907"},"modified":"2010-04-24T07:18:28","modified_gmt":"2010-04-24T14:18:28","slug":"circle-mouse-toy","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=509","title":{"rendered":"Circle Mouse Toy"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar circles:Array = &#x5B;];\r\nfor (var i:int = 0; i&lt;30; i++){\r\n\tvar c:Sprite = makeCircle();\r\n\tc.x = stage.stageWidth \/ 2;\r\n\tc.y = stage.stageHeight \/ 2;\r\n\tc.scaleX = 1 + i\/2;\r\n\tc.scaleY = 0.5 + i\/4;\r\n\taddChild(c);\r\n\tcircles.push(c);\r\n}\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\tcircles&#x5B;0].y += (mouseY - circles&#x5B;0].y) \/ 4;\r\n\tfor (var i:int = 1; i&lt;circles.length; i++){\r\n\t\tvar pre:Sprite = circles&#x5B;i - 1];\r\n\t\tcircles&#x5B;i].y += (pre.y - circles&#x5B;i].y) \/ 4;\r\n\t}\r\n}\r\nfunction makeCircle():Sprite{\r\n\tvar s:Sprite = new Sprite();\r\n\twith(s.graphics){\r\n\t\tlineStyle(0,0x000000);\r\n\t\tdrawCircle(0,0,10);\r\n\t}\r\n\treturn s;\r\n}\r\n<\/pre>\n<p>This morning I woke up with a vision of this simple mouse toy in my head. I decided I might as well code it up&#8230; I may do more simple things like this in the next few days, it&#8217;s relaxing.<\/p>\n<div style=\"text-align:center;width:465px;\"><iframe loading=\"lazy\" title=\"Mouse Toy - wonderfl build flash online\" scrolling=\"no\" src=\"http:\/\/wonderfl.net\/blogparts\/jkCr\" width=\"465\" height=\"490\" style=\"border:1px black solid;\"><\/iframe><a href=\"http:\/\/wonderfl.net\/c\/jkCr\" title=\"Mouse Toy - wonderfl build flash online\">Mouse Toy &#8211; wonderfl build flash online<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>var circles:Array = &#x5B;]; for (var i:int = 0; i&lt;30; i++){ var c:Sprite = makeCircle(); c.x = stage.stageWidth \/ 2; c.y = stage.stageHeight \/ 2; c.scaleX = 1 + i\/2; c.scaleY = 0.5 + i\/4; addChild(c); circles.push(c); } addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { circles&#x5B;0].y += (mouseY &#8211; circles&#x5B;0].y) \/ 4; for (var i:int = 1; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,94,13],"tags":[99,14,4],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-graphics","category-misc","category-motion","tag-actionsnippet","tag-as3","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=509"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/509\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}