Best products from r/as3

We found 7 comments on r/as3 discussing the most recommended products. We ran sentiment analysis on each of these comments to determine how redditors feel about different products. We found 7 products and ranked them based on the amount of positive reactions they received. Here are the top 20.

Top comments mentioning products on r/as3:

u/catharso · 1 pointr/as3

Get yourself a copy of Code Complete or something similar. I own the first edition, which is super old, but still very applicable and super cheap if you buy it used (cheapest i saw: $0.21 + 3.99$ shipping). Read it and try to figure out that way how you could improve your code.

Don't use the Flash IDE. Use FlexBuilder or the open source and (partially) super awesome FlashDevelop instead, because a good programmer will always try to use the best tools available. The FlashIDE simply isn't made for complex programming work.

Try to always create classes with a single field of responsibility. Read about some patterns like ModelViewController and try to grasp what it tries to achieve; then try to achieve the same thing. Even it doesn't fit or seems confusing; if you get something done that looks different but behaves similar you're on a good path.

Use only strict static typing and try to set the compiler to treat warnings as errors.

have fun.

u/otown_in_the_hotown · 1 pointr/as3

No problem. Now that I have a bit more time, I thought I'd try and explain exactly what was wrong. (I'd love to use bullet points, but for some reason that was messing up the formatting of the code snippets).

You had functions inside functions. I suppose there's nothing technically wrong with it, it's just not really recommended. You're essentially creating anonymous functions that then can't be referenced from outside of that main containing function. For instance, if you ever wanted to be able to garbage collect the pictureTimer, you wouldn't be able to because if you tried to remove the event listener like so:
pictureTimer.removeEventListener(TimerEvent.TIMER, pictureChange);
you couldn't since you couldn't access the pictureChange function.

You had a timer in there (called timer) that wasn't really doing anything. It was just running once a second without actually triggering any code. A timer running uselessly once a second won't really affect performance. It's just something that can easily be trimmed out.

Doubling up of code. As a rule you don't ever want to write the same code twice. The code I'm referring to is:
var ripplePicture:MovieClip = getRandomPicture();
rippleBitmap.draw(ripplePicture);
rippleTarget=new Bitmap(rippleBitmap);
addChild(rippleTarget);
myRippler=new Rippler(rippleTarget,20,5,5);

You have it once in the Ripple function and then again within the pictureChange function.

Regarding the myRippler object, I have no idea what the Rippler class looks like, but it's probably not necessary to create a new instance of it each time you create a new image. There's likely (or should be) a method in there to just set a new bitmap as its source.

Regarding your images, it looks like you've embedded each one in a separate MovieClip within your FLA. Since your Rippler class is expecting a bitmap as its first parameter, it would much simpler and easier on the processor to just export the bitmaps themselves. There's no need to encapsulate them in MovieClips. Just set the same export id you've got on those MovieClips to the bitmaps. Then delete the MovieClips.

That would change this code:
var ripplePicture:MovieClip = getRandomPicture();
rippleBitmap.draw(ripplePicture);
rippleTarget=new Bitmap(rippleBitmap);
addChild(rippleTarget);
myRippler=new Rippler(rippleTarget,20,5,5);

To this:
var rippleTarget:Bitmap = new Bitmap( getRandomPicture() );
addChild(rippleTarget);
myRippler=new Rippler(rippleTarget,20,5,5);

You would also have to change the getRandomPicture function to return a BitmapData instead of a MovieClip.

And finally, anything that will at some point need to be garbage collected should be set as variables outside of any functions so they're scope is accessible to any other function in the class. Garbage collection is a whole other topic on its own. I don't think I can really cover it adequately here, but just searching "garbage collection as3" should give you as much as you need to know.

Hope that helps. Best of luck. Incidentally, the book I recommend to my students as an excellent beginner's guide to AS3 Object Oriented Programming is Learning Actionscript 3.0

EDIT: Goddamnit. No matter what, I can't seem to get the code to look like code. It does in my Live Preview but not when I save. Sorry about that.

u/PoisonTaffy · 2 pointsr/as3

OOP is a mature technique that has been covered in plenty of great texts.

A good starting point regarding OOP in AS3 would be this book. It's not the best OOP book I've read, but it's inspired by the good books, and unlike them, targets AS3 specifically.

Fortunately, good oop habits in AS3 aren't very different than good oop habits in other oo languages, so lessons learned in other languages are transferable (other than specific cases that aren't implementable in AS3, like multiple inheritance), therefore once you feel comfortable with the idea behind oo techniques like inheritance, composition, etc. you can read better books that use code in other languages.

u/all_or_nothing · 3 pointsr/as3

First, I would say spend some time prototyping what you want with simple shapes. Experiment with what you can do and how you want to do it. Once you're satisfied with what you can do, breakdown the game into smaller tasks and list those out with target deadlines. Try to stick to one thing until it's done and move onto the next one. Smaller goals are easier to achieve and will give you the confidence and enthusiasm to keep going.

As for technical stuff, I would say read up on object oriented programming and programming design patterns. There are a few books out there that are specific to AS3 and explain the most common patterns well. Be careful though not to use design patterns for their own sake. Each pattern is meant to handle specific cases that arise commonly.

Finally, I would say don't try to re-invent the wheel. By this, I mean don't try to program your own engine, etc. There are several very good Flash game engines out there like Flixel, FlashPunk, etc. Leverage what you can from those so you can focus on your game. Also, have people play it early and often so you can get feedback and make changes. It's easier to make changes earlier in the process.

EDIT: As far as forums I have been a member of the following forums/blogs for years and they have a plethora of information:

gotoAndLearn

Kirupa

8-bit Rocket author of this book