AS2 vs. AS3 Button

AS2 vs. AS3 Button

Post by OgreOn » Mon, 17 Sep 2007 11:36:35

So in AS2 to add button functionality to a movie clip, you'd type:


How is this accomplished in AS3 WITHOUT using external .as files, classes, etc?
It seems like all the tutorials/books I read, they want to create the bible
before anything can be done.

If this is the case, why is AS3 better? I understand it appeals more to hard
core programmers of Java, but what about therun-o-the-mill types who actually
like Director's Lingo and can cope with AS2?


AS2 vs. AS3 Button

Post by Ardy15ja » Tue, 18 Sep 2007 01:58:06

Well, one of the big advantages AS3 has is that it`s 10 times faster than AS2.
Then, it`s easyer to learn for beginners, because everyting is done similarly(
you decalre any variable the same way, every listener etc...) etc...

myButton.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);

function onMouseDown(event:MouseEvent):void {
// No external .as files, no bibles written :)


AS2 vs. AS3 Button

Post by SpaceGir » Tue, 18 Sep 2007 21:09:44

AS3 is harder to get started, but far more powerful than AS2 once you
get into it. AS3 is very consistent (so, it's always the same way to do
everything), so once you learn how it "works" you should have no problem
when exploring/learning new functionality. It's also a lot more
efficient; while you may end up writing a little more code, the end
result will be smaller, 10 times (or more) faster, and use less memory.

Because AS3 is a lot more strict in its structure and usage, it's also a
lot easier to read other folks code: everyone has to follow a pattern of
sorts, meaning if you use example code, or hire in a programmer to help
you or other Flash designer/developers working on your product it's MUCH
easier for them to understand quickly.

AS3 is also ECMA standards based, so if you ever do want to move to
another modern language you won't have to start over... all ECMA
languages are very similar.

AS3 is worth the extra effort; it might seems convoluted and over the
top at the start (q: why this new events model? You have to write twice
as much!), but ultimately it's so much more powerful (a: custom events,
only firing events when you want them to; reusable events; faster
running movies; all event code works the same way, etc).

I'm not programmer... I only learn what I need to know to build the
experiences my clients demand for their users. If I could avoid
programming completely, I'd be a very happy girl! However, AS3 is
*superb*, and allows you to do things now that were almost unimaginable
a year ago. Stick with it. A month or two of struggling and then you'll
never look back.


x theSpaceGirl (miranda)


Kammy has a new home: