Learn AS3 instead of AS2.

26 posts

Flag Post
When I started making Flash games, I looked for tutorials and found an AS2 one; I didn't even know that AS3 existed.
After a few months, I had to switch to AS3 because AS2 was limiting me and making it impossible to achieve my goals.

Now that I know AS3, I can't stop regretting all he wasted time with that nightmare known as AS2.
I never had someone telling me how bad AS2 was or that I should instead learn AS3, and I don't want others to waste months learning an useless, slow, dumb and deprecated language, so here's a pretty resumed list of reasons for you to

Learn AS3 instead of AS2

Note that this is meant for newbies, as any semi experienced programmer can tell that AS2 is worth nothing after taking a look at some sample code.


History:

AS2 was a revision of AS1 and while it added some new functionalities, the code compiled to the same bytecode as AS1; it's like covering a pile of trash and building over it.

AS3 uses an entirely different VirtualMachine and rather than being a patch to AS2, it's a new language; a whole restructure.

Adobe's language reference for AS2 explains that "ActionScript 2.0 is a legacy implementation of the ActionScript programming language, and has been replaced by ActionScript 3.0".1


Speed:

Nobody likes slow games; there are few things as annoying as a laggy game.

You can make fast games in AS2 to some extent as long as your code is flawless and super optimized.

AS3 code executes way faster (around 10 times faster) than AS2's code, so while it's still recommended that you work on writing fast code (because AS3 isn't lag free), you won't be facing lag issues as often.
Also, while optimizing AS2 allows you to make decent games, a super optimized AS3 application offers endless posibilities.
Perfect collisions and physics? Check.2 Thousands of particles? Check.3  No way to do that in AS2 without totally killing performance.


Coding:

AS2 allows you to compile pretty much anything you can type. Of course, that doesn't mean it will run or work, it just means that it will silently fail, leaving it up to you to search among thousands of lines of code looking for the cause.
It even allows you to write code inside of objects. In conclusion; it's a hell, an ocean of nonsense where your sanity decreases at the same rate of your chances of achieving your goals.

AS3 enforces OOP: use classes, no more object-code. Type variables, be explicit with datatypes for arguments and return values.
Most important, you can debug if you use AS3, so if you try to compile something with an error, it will fail and tell you what's wrong. Same for runtime; if there's an issue with your logic, the application will throw an exception and point you to the issue, instead of just lagging your computer to death like AS2 applications.


But I'm a beginner and AS2 is easier...

False. The "AS2 is easier" argument is used by people who lack the required skills to be a programmer. If that's your case, you can use tools like Stencyl, which don't even require you to code and will run faster than an AS2 application.4

AS3 may require you to type a couple of extra characters every now and then, but it's actually easier, since it makes sense; everything follows the same logic, you have control over your application and are able to manipulate it at will.
AS2 applications fail for random reasons. ie, your objects may be randomly destroyed, or the same, perfectlty fine AS3 code will produce different results.

As it was mentioned, AS3 favours OOP, so you always know what each object is, what kind of values are expected, where and why. It couldn't get easier than that.

If you want another example of why AS2 sucks,  how about being able to transform objects into anything? Or mix them with random stuff?
ie, x=100; x+="hello, world"; x=new MovieClip()["WTF"].a.b.c["omg, god, why!?"]; is considered perfectly logical in an AS2 application. A real world version of that would be to have a coffee machine turning into an elephant's unborn offspring.
If you think that's easy, go ahead... but don't get it wrong; being able to get away with terrible code (that won't run anyway) doesn't mean the language is easier.

Also, the web is filled with AS3 articles and tutorials, and most experienced Flash programmers use it, so you'll be able to solve your issues really fast.


I could simply learn AS2 and then move to AS3, right?

No. As it's been explained, AS3 isn't a patch for AS2. It's a totally different language that was made because AS2 was beyond salvation. There was no way to fix AS2; they had to build it from zero.
Learning AS2 won't help you learn AS3 and insead will make it harder because you'll have to get rid of all the bad practices you got from it.


But this amazing programmer used AS2 to make a great game!

And Bauby wrote a book by blinking his eye, because he was fucking paralyzed!5

Yes. Many great games were done in AS2, because AS3 didn't exist back then, or because those programmers were still learning it but had to keep making games to bring food to the table.

Instead of telling me how many good programmers used AS2 at some point, why don't you link a recent quote of a great programmer who defends AS2? I dare you.

Do you think Adobe spent millions and such a huge team developing, updating and supporting AS3 just because they had nothing better to do? It was created because AS2 didn't satisfy the requirements anymore, and that was some years ago.

Also, they are/were great programmers for a reason; you, as someone just getting into the game development world, don't stand a snowball's chance in hell if you pick such an outdated and useless tool for this job.


Professional programming?    

A nice dream and a harsh reality. But it's something most of us want at some point.
If you want to succeed, you'll have to make good games, which involves using a tool that doesn't limit your creativity. You need AS3.

Not enough? Besides making a good game, you need people to play it, know it and share it.
You can't use multiplayer services like PlayerIO or Gamooga. Half of the APIs  won't work in AS2 or will cause issues.

More? Less than 15% of the marketed games used AS2 during the last year.6

What about making console-quality games? Not even in your dreams if you use AS2.7
AS3 offers you access to Stage3d and a lot more stufff which can make the difference between a goldmine and just another game.

Farmville 2, Machinarium, Tanki Online... you name it, it wouldn't have been possible without AS3.


Conclusion:

AS3 is...
Faster: Code properly and you won't have to worry about lag.
Supported: IDEs are stopping support for AS2 and all the recent tutorials are for AS3. New APIs and technologies sometimes won't be compatible with AS2.
Popular: iOS, Android, Facebook. The audience increases if you use AS3. So do your earnings.
Easier: If you're a newbie, you'll love how logical and simple it is, plus you'll never run short of free tutorials all over the web. If you already know some other languages, it'll be a matter of getting used to the syntax, as usual.

AS2 is...
worse in every aspect.
 
Flag Post

Hopefully this won’t be needed for long, since IDE’s won’t even support it anymore, but here it is, just in case the cancer persists.

 
Flag Post

Even if the title/header continues the previous sentence, the first letter should be capitalized.
> "AS2 was a revision of AS2 [...]"
> "[...] and are able to manipulae it at will"
> "A nice dream and a harsch reality."

Also, you should be able to get rid of all textile formatting by wrapping the post in notextile tags. (Note that this will also mean you need to define the line breaks and paragraphs html-style.) I did that here, which is why the quotation marks aren't slanted.

 
Flag Post

Thanks. The notextile tag did the trick.

 
Flag Post

Duly noted and a tip o the hat to you fine sir.

 
Flag Post

Umm… I’m still having trouble making a simple upgrade shop with AS2, do you think this would be easier to accomplish with AS3?

 
Flag Post
Originally posted by JPVR150296:

Umm… I’m still having trouble making a simple upgrade shop with AS2, do you think this would be easier to accomplish with AS3?

It would all be relative to the experience of the programmer.

 
Flag Post

You have to understand the language first, then you won’t ask how to make an upgrade shop, a horde of zombies or whatever; once you understand the elements of the language, what they are, when to use them and how to interact with them, then you’ll stop looking for ways to do things and instead will spend hours looking for the best way to do them.

That said, I think it’s way easier to understand/learn AS3; ergo, everything is easier to accomplish in AS3, given that you actually bother understanding it.

 
Flag Post

Nice work, maybe this could be a link inside the ‘how to make flash games’ sticky.

Also, “Now that I know AS3, I can’t stop regreting all he wasted time with that nightmare known as AS2.”
Should be :“Now that I know AS3, I can’t stop regretting all the wasted time with that nightmare known as AS2.”

 
Flag Post
Originally posted by JPVR150296:

Umm… I’m still having trouble making a simple upgrade shop with AS2, do you think this would be easier to accomplish with AS3?

Learning a language because you started a project in it just isn’t going to work. Start with very easy projects first (in AS3) and gradually increase the complexity of them. I don’t recommend continuing the rpg project.

 
Flag Post
Originally posted by JohnnyBohnny:

Should be :“Now that I know AS3, I can’t stop regretting all the wasted time with that nightmare known as AS2.”

Shouldn’t it rather be “I can stop regretting”? It’s over and done, Senekis, move one with your life. ^^

That said, as a relative newcomer to Flash programming, I do appreciate the warning. When I started with Flash I read about the available options and found something along the lines of “AS2 is simpler to learn but AS3 is more powerful.” Undeterred, and confident in my skills, I went with AS3. I have never done anything with AS2, but from code snippets occasionally posted in this forum, it holds in me the kind of morbid fascination normally reserved for train wrecks and serial killers.

So thank you for your post Senekis and it’s OK, you’re going to be fine.

 
Flag Post
Originally posted by Ace_Blue:
Originally posted by JohnnyBohnny:

Should be :“Now that I know AS3, I can’t stop regretting all the wasted time with that nightmare known as AS2.”

Shouldn’t it rather be “I can stop regretting”? It’s over and done, Senekis, move one with your life. ^^

We all have regrets, I regret each day that I didn’t start game development when I was 14 years old (at that time I already knew flash it was Macromedia Flash 6 I guess, and was making movies but not games), that’s pretty tough to understand that game design is the most interesting path only after graduating from a college..
Sometimes it gets tough to think about all that wasted time, but one must notice that many people have similar thoughts, a man which understood his passion at a very young age is quite rare but very lucky though.

 
Flag Post

Link in hub thread that UG is making.

Originally posted by Senekis93:

Farmville 2, Machinarium, Tanki Online… you name it, it wouldn’t have been possible without AS3.

Farmville?! I’m going to AS2 then…

 
Flag Post

Machinarium is just clicking somewhere and seeing an animation. That could have been made in AS0.5

 
Flag Post
Originally posted by AMD_Paulius_J:
Originally posted by Ace_Blue:
Originally posted by JohnnyBohnny:

Should be :“Now that I know AS3, I can’t stop regretting all the wasted time with that nightmare known as AS2.”

Shouldn’t it rather be “I can stop regretting”? It’s over and done, Senekis, move one with your life. ^^

We all have regrets, I regret each day that I didn’t start game development when I was 14 years old (at that time I already knew flash it was Macromedia Flash 6 I guess, and was making movies but not games), that’s pretty tough to understand that game design is the most interesting path only after graduating from a college..
Sometimes it gets tough to think about all that wasted time, but one must notice that many people have similar thoughts, a man which understood his passion at a very young age is quite rare but very lucky though.

I don’t regret starting with programming so late in my life, since I did a bunch of interesting stuff before that, but the AS2 part was a total waste of time, and wasting time is annoying.

 
Flag Post

I like action script 2.0. It never let me down, it is easier to understand, and easier to implement. I must say that the only thing that I didn’t like was the script max from an actions script file (you can do only 600 lines or something like that). For little games action script 2.0 is perfect, but for business and stuff learn 3.0. None requires 2.0 :(

 
Flag Post
Originally posted by Gheata:

I like action script 2.0. It never let me down, it is easier to understand, and easier to implement. I must say that the only thing that I didn’t like was the script max from an actions script file (you can do only 600 lines or something like that). For little games action script 2.0 is perfect, but for business and stuff learn 3.0. None requires 2.0 :(

If it’s never let you down, then you’re obviously not very experienced- it fails in TONS of categories.

 
Flag Post

Perhaps, but after I will be a pro in 2.0 I will think about moving to 3.0 ’Till then, I will use it.

 
Flag Post

Not everyone who wants to make games is a strong programmer. A well-designed AS2 game is better than a poorly-designed AS3 one. You could be an amazing programmer but not know how to design a good game. I acknowledge that AS2 is clunkier than AS3, but it can get the job done.

 
Flag Post
Originally posted by GameBuilder15:

Not everyone who wants to make games is a strong programmer. A well-designed AS2 game is better than a poorly-designed AS3 one. You could be an amazing programmer but not know how to design a good game. I acknowledge that AS2 is clunkier than AS3, but it can get the job done.

Where did I say something about games? Much less designing them! I’m talking about the language in general- it’s complete shit and has a ridiculous amount of fallbacks and limitations.

 
Flag Post

AS2. It can be useful and can get things done. But in most (if not all) cases, AS3 outperforms it.

There’s nothing “wrong” with using AS2. It’s just that AS3 is better and generally more useful.

 
Flag Post

I’m only just starting to get the hang of as2, it works fine and I’m familiar with it.

 
Flag Post
Originally posted by Senekis93:
But I’m a beginner and AS2 is easier…

False. The “AS2 is easier” argument is used by people who lack the
required skills to be a programmer. If that’s your case, you can use
tools like Stencyl, which don’t even require you to code and will run
faster than an AS2 application.

This statement is so… i dont know how to describe it.
Its easier BECAUSE you dont need as much skill

 
Flag Post

It seems easier and, to an extent, is easier, for simple tasks. But as complexity increases, difficulty increases more in AS2 than in AS3.

 
Flag Post

I think learning as2 helped me a lot in learning as3. Sure, I realized that things were pertty slow in as2, and when I siwtched to as3 some things were a lot easier, like removing things from an array. Demeaning people who use as2 by saying they cant program is not helpful in the least bit though. Its a great place to start to learn how to be a programmer. Easy start, and although it wont get you as far as youd need to be, it still starts you off.