{"id":2572,"date":"2013-02-15T18:09:56","date_gmt":"2013-02-16T01:09:56","guid":{"rendered":"http:\/\/www.nathalielawhead.com\/candybox\/?p=2572"},"modified":"2014-03-18T23:52:32","modified_gmt":"2014-03-19T06:52:32","slug":"the-old-frog-pond-tutorial-in-3-0","status":"publish","type":"post","link":"https:\/\/www.nathalielawhead.com\/candybox\/the-old-frog-pond-tutorial-in-3-0","title":{"rendered":"The Old Frog Pond Tutorial (In 3.0)"},"content":{"rendered":"<p>Several years ago I co-authored in <em>New Masters Of Flash Volume 3<\/em>, and wrote a tutorial for it which extensively covered illustrating in Flash then bringing the graphics to life with code\u2026 adding the interactive layer.<br \/>\nIt crossed my mind that I could port it to <em>Actionscript 3.0<\/em> for fun! I really loved making it. The original <a href=\"http:\/\/nathalielawhead.com\/sourcefiles\/Frog_Pond\/frog_3.0.swf\" target=\"_blank\">Frog Pond<\/a> was part of an unreleased portion of <a href=\"http:\/\/bluesuburbia.com\" target=\"_blank\">BlueSuburbia<\/a>. <a href=\"http:\/\/bluesuburbia.com\" target=\"_blank\">BlueSuburbia<\/a> <em>is 100% vector art<\/em>, and, as was the case with all the graphics in <a href=\"http:\/\/bluesuburbia.com\" target=\"_blank\">BlueSuburbia<\/a>, it was drawn in Flash. The original tutorial (found in the book) is still an excellent walkthrough for how to approach creating graphics in Flash. Doing so is something I enjoy a lot because it saves a lot of time.<br \/>\nSo here it is. The Frog Pond 3.0.<\/p>\n<p><a href=\"http:\/\/nathalielawhead.com\/sourcefiles\/Frog_Pond\/frog_3.0.fla\" target=\"_blank\">DOWNLOAD THE SOURCE HERE (3.0).<\/a><\/p>\n<p>[swfobj src=&#8221;http:\/\/nathalielawhead.com\/sourcefiles\/Frog_Pond\/frog_3.0.swf&#8221; height=&#8221;600&#8243; width=&#8221;550&#8243;]<br \/>\n<a href=\"http:\/\/nathalielawhead.com\/sourcefiles\/Frog_Pond\/frog_3.0.swf\" target=\"_blank\">Click Here for full screen!<\/a><\/p>\n<p>It&#8217;s got some fun tricks in it. Like making a cursor that follows the mouse with friction and rotation pointing in the direction of the mouse movement.<br \/>\nLike so\u2026<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #888888\">\/\/rotating follow mouse function<\/span>\r\n<span style=\"color: #008800; font-weight: bold\">function <\/span><span style=\"color: #0066BB; font-weight: bold\">mouseRotFunc<\/span><span style=\"color: #333333\">(<\/span>event<span style=\"color: #333333\">:<\/span><span style=\"color: #333399; font-weight: bold\">Event<\/span><span style=\"color: #333333\">)<\/span> <span style=\"color: #333333\">{<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">var<\/span> clip:<span style=\"color: #333399; font-weight: bold\">MovieClip<\/span> <span style=\"color: #333333\">=<\/span> MovieClip<span style=\"color: #333333\">(<\/span>event<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">currentTarget<\/span><span style=\"color: #333333\">);<\/span>\r\n\t<span style=\"color: #888888\">\/\/check how far the movie clip is from the cursor<\/span>\r\n\t<span style=\"color: #888888\">\/\/with a little friction added<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">var<\/span> disX:<span style=\"color: #333399; font-weight: bold\">Number<\/span> <span style=\"color: #333333\">=<\/span> <span style=\"color: #333333\">(<\/span>mouseX<span style=\"color: #333333\">-<\/span>clip<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">x<\/span><span style=\"color: #333333\">)\/<\/span><span style=\"color: #0000DD; font-weight: bold\">6<\/span><span style=\"color: #333333\">;<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">var<\/span> disY:<span style=\"color: #333399; font-weight: bold\">Number<\/span> <span style=\"color: #333333\">=<\/span> <span style=\"color: #333333\">(<\/span>mouseY<span style=\"color: #333333\">-<\/span>clip<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">y<\/span><span style=\"color: #333333\">)\/<\/span><span style=\"color: #0000DD; font-weight: bold\">6<\/span><span style=\"color: #333333\">;<\/span>\r\n\t<span style=\"color: #888888\">\/\/calculate the angle in radians then convert <\/span>\r\n\t<span style=\"color: #888888\">\/\/it to degrees (plus 90)<\/span>\r\n\t<span style=\"color: #888888\">\/\/so that the movie clip rotates<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold\">var<\/span> myRads:<span style=\"color: #333399; font-weight: bold\">Number<\/span> <span style=\"color: #333333\">=<\/span> Math<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">atan2<\/span><span style=\"color: #333333\">(<\/span>disY<span style=\"color: #333333\">,<\/span> disX<span style=\"color: #333333\">);<\/span>\r\n    <span style=\"color: #008800; font-weight: bold\">var<\/span> myDegs:<span style=\"color: #333399; font-weight: bold\">Number<\/span> <span style=\"color: #333333\">=<\/span> Math<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">round<\/span><span style=\"color: #333333\">(<\/span>myRads<span style=\"color: #333333\">*<\/span><span style=\"color: #0000DD; font-weight: bold\">180<\/span><span style=\"color: #333333\">\/<\/span>Math<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">PI<\/span><span style=\"color: #333333\">)+<\/span><span style=\"color: #0000DD; font-weight: bold\">90<\/span><span style=\"color: #333333\">;<\/span>\r\n\t<span style=\"color: #888888\">\/\/apply all of the above<\/span>\r\n\tclip<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">x<\/span> <span style=\"color: #333333\">+=<\/span> disX\r\n\tclip<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">y<\/span> <span style=\"color: #333333\">+=<\/span> disY\r\n    clip<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">rotation<\/span> <span style=\"color: #333333\">=<\/span> myDegs<span style=\"color: #333333\">;<\/span>\r\n<span style=\"color: #333333\">}<\/span>\r\ncursor_mc<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">addEventListener<\/span><span style=\"color: #333333\">(<\/span>Event<span style=\"color: #333333\">.<\/span><span style=\"color: #0000CC\">ENTER_FRAME<\/span><span style=\"color: #333333\">,<\/span>mouseRotFunc<span style=\"color: #333333\">);<\/span>\r\n<\/pre>\n<\/div>\n<p>You can also get the <a href=\"http:\/\/nathalielawhead.com\/sourcefiles\/Frog_Pond\/\" target=\"_blank\">old (ActionScript 2.0\/1.0) version her<\/a>e.<\/p>\n<p>Fun stuff!<\/p>\n<p>I&#8217;m a big fan of vector art. I think it animates beautifully, and is a pleasure to look at. I love the clean, smooth, cartoon style lines. Get good at it and you can add an amazing amount of detail to it. That&#8217;s when it truly shines! You can see your own science fiction, fantasy, rich environments, or other works of art come to life with however much scalable complexity you want. I never get tired of that concept.<\/p>\n<p>&#8230;In the end, there&#8217;s nothing like talking to an artificial intelligence stuck in some giant machine animated with scrap metal, steam, valves, and many robot arms.<br \/>\nLike so\u2026<\/p>\n<p>Go ahead. You can talk to the bellow example!<br \/>\nJust turn it <strong>ON<\/strong> first. :)<br \/>\n[swfobj src=&#8221;http:\/\/nathalielawhead.com\/sourcefiles\/Chatbot_Programe_E_Flash\/I.swf&#8221; height=&#8221;500&#8243; width=&#8221;800&#8243;]<br \/>\n<a href=\"http:\/\/nathalielawhead.com\/sourcefiles\/Chatbot_Programe_E_Flash\/I.swf\" target=\"_blank\">Click here for full screen!<\/a><\/p>\n<p>For a tutorial on how to set up your own <a href=\"http:\/\/www.nathalielawhead.com\/candybox\/programe-e-alice-aiml-bot-using-flash-php-actionscript-walkthrough-source-files\" target=\"_blank\">ALICE Chatbot (Program E), and how to create\/program the Flash front end, click here<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Several years ago I co-authored in New Masters Of Flash Volume 3, and wrote a tutorial for it which extensively covered illustrating in Flash then bringing the graphics to life with code\u2026 adding the interactive layer. It crossed my mind that I could port it to Actionscript 3.0 for fun! I really loved making it. The original Frog Pond was part of an unreleased portion of BlueSuburbia. BlueSuburbia is 100% vector art, and, as was the case with all the graphics in BlueSuburbia, it was drawn in Flash. The original tutorial (found in the book) is still an excellent walkthrough&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":4522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[12],"tags":[],"class_list":["post-2572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-resources"],"_links":{"self":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/2572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/comments?post=2572"}],"version-history":[{"count":12,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/2572\/revisions"}],"predecessor-version":[{"id":3031,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/posts\/2572\/revisions\/3031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/media\/4522"}],"wp:attachment":[{"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/media?parent=2572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/categories?post=2572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathalielawhead.com\/candybox\/wp-json\/wp\/v2\/tags?post=2572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}