{"author_name":"Alexander The 1st","cat":"LD #22","comments":[],"epoch":1324091100,"likes":0,"metadata":{"p_key":"62136","p_author":"Alexander The 1st","p_authorkey":"7803","p_urlkey":"97902","p_title":"MileStone Get! Or another way to put it, how to avoid Actionscript 2.0 traps and finally get to Acti","p_cat":"LD #22","p_event":"LD22","p_time":"1324091100","p_likes":"0","p_comments":"0","p_status":"UPD5","us_key":"7803","us_name":"Alexander The 1st","us_username":"at1st","event_start":"1323993600","event_key":"8","event_name":"LD22"},"text":"<p>So&#8230;not too much at the moment done, but that&#8217;s in part because I now may (I presume, that is) the final official jump to Actionscript 3.0!<\/p>\n <p>&nbsp;<\/p>\n <p>&#8230;<\/p>\n <p>&#8230;Okay, this is an important point for me because I&#8217;ve been stuck in Actionscript 2.5 (Half 2.0, half 3.0) for&#8230;about four years now? I haven&#8217;t been actively working on it that entire time, in fact&#8230;not really at all last year, and well, I&#8217;m proud of this change, at least.<\/p>\n <p>&nbsp;<\/p>\n <p>I&#8217;ve done Python and Java OOP programming fine before, but I first got programming in Actionscript 2.0. Which let you code on frames. Which I do. A lot of the time. So&#8230;transitioning to Actionscript 3 has been&#8230;not so smooth.<\/p>\n <p>&nbsp;<\/p>\n <p>Part of the problem&#8230;okay, pretty much all of it, has been creating an ActionScript object.<\/p>\n <p>&nbsp;<\/p>\n <p>Which I got the final working copy of my code working by going here:<\/p>\n <p>&nbsp;<\/p>\n <p><a href=\"http:\/\/www.flepstudio.org\/forum\/object-oriented-programming-tutorials\/440-tutorial-1-my-first-3-0-class.html\">http:\/\/www.flepstudio.org\/forum\/object-oriented-programming-tutorials\/440-tutorial-1-my-first-3-0-class.html<\/a><\/p>\n <p>Thing is, this doesn&#8217;t *quite* work for me &#8211; I wanted variables already, and functions!<\/p>\n <p>&nbsp;<\/p>\n <p>So&#8230;aside from that tutorial, the following things to keep in mind &#8211; some of these are somewhat interesting:<\/p>\n <p>&nbsp;<\/p>\n <ul>\n <li>First off &#8211; even if you aren&#8217;t putting your Actionscript .as files (See the tutorial above if you don&#8217;t know what I&#8217;m talking about), you still need a package wrapper around your class. Which is different than Java, where having no named package for the file let you leave it alone. Default package is just &#8220;package{&#8221; &#8211; Yeap, no name, just the bracket (Make sure you close it at the end of the file &#8211; properly).<\/li>\n <\/ul>\n <p>&nbsp;<\/p>\n <ul>\n <li>Secondly, the constructor&#8217;s&#8230;considered a function. So for your constructor, it has to go like so:<\/li>\n <\/ul>\n <p><code>public function LightGrid(){<\/code><\/p>\n <p><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/....<\/code><\/p>\n <p><code>}<\/code><\/p>\n <ul>\n <li>\u00a0Thirdly, when doing this, and linking it from an item in the library of default Flash (Right-click object in library, go to Linkage, Make sure you select &#8220;Export for ActionScript&#8221;, and input your .as file&#8217;s name in there, and hit the checkmark to validate it), DO NOT leave versions of it on your stage &#8211; it&#8217;ll complain about them if you reference them, so it&#8217;s just better practise.<\/li>\n <\/ul>\n <p>Um, yeap. About all I can think of now &#8211; though you can start viewing the source (When updated) here:<\/p>\n <p>&nbsp;<\/p>\n <p><a href=\"http:\/\/www.sfu.ca\/~ajr12\/LudumDare22\/LudumDare\/\">http:\/\/www.sfu.ca\/~ajr12\/LudumDare22\/LudumDare\/<\/a><\/p>\n <p>Enjoy!<\/p>\n <p>&nbsp;<\/p>\n <p>&nbsp;<\/p>\n <p>&nbsp;<\/p>","time":"December 16th, 2011 10:05 pm","title":"MileStone Get! Or another way to put it, how to avoid Actionscript 2.0 traps and finally get to Actionscript 3.0"}