View Full Version : AS3 vs AS2
fw2803
October 17th, 2007, 06:35 AM
Hi there
AS3 starts roaming around. I feel a little bit silly to continue with AS2 so I am thinking of switching. My question is: What, in AS2, are changed in AS3? Is there any change in syntax?
Thanks a lot
Aquilonian
October 17th, 2007, 06:46 AM
the display list, the events, the listeners of events...wich are now only functions not another classes...bitmapData is the same, thats good
Mekelan
October 17th, 2007, 07:16 AM
Hmm yeah I was wondering the same thing, as I have programmed alot in AS 2.0, but 3.0 is starting to knock on my door.. and I too have just started a new large-ish project in AS 2.0. It does seem like alot has changed though, for one thing there's no more placing AS on MovieClips - a change I personally have a hard time getting over (even if I shouldn't). I think in the end I'll do the large-ish project in 2.0 (go out with a bang and all that jazz), and then whatever smallish ones I get along the way I'll move over to 3.0. There are some documents about migrating on Adobe's site though I think, or maybe it's in the help files, I am not sure.
ajcates
October 17th, 2007, 07:36 AM
Basically the went thur and cleaned up AS2, gave it some dandy new classes, made a much better event system, gave it more OOP power. Also its much faster, I have to say tho I write about 1/3 more code with AS3 but I don't mind because it all seems much cleaner.
Balala
October 17th, 2007, 07:43 AM
http://www.kirupa.com/forum/showthread.php?t=223798
Aquilonian
October 17th, 2007, 12:22 PM
The AS3 stages:
1 lets try this, might be easy
2 hey, why onEnterFrame dont work?
3 omg i hate all that
4 why _root.this _root.that dont work??
5 why my objects are not being deleted after i nullify them???
6 why it traces errors for anything??????
( and if you dont give up...)
7 finally, now i have less errors and have to type 3x more, but at least is fast
fw2803
October 17th, 2007, 12:34 PM
Right. Thanks a lot for the information. I'll consider that a bit...
Gazurt
October 17th, 2007, 01:50 PM
The AS3 stages:
1 lets try this, might be easy
2 hey, why onEnterFrame dont work?
3 omg i hate all that
4 why _root.this _root.that dont work??
5 why my objects are not being deleted after i nullify them???
6 why it traces errors for anything??????
( and if you dont give up...)
7 finally, now i have less errors and have to type 3x more, but at least is fast
:lol: That was good :D
Templarian
October 17th, 2007, 01:52 PM
Sirisian has shown a lot of solid reasons why actionscript 3 is faster and better to be used. Do an advanced search and look around for his name and look at some of the things that one can do.
... good luck. One big plus is that you can use FlashDevelop instead of the Flash IDE.
blitzzz
June 17th, 2008, 11:04 AM
I have not yet upgraded from (Macromedia’s) Flash 8 to Adobe’s CS 3..
Mainly because it does not have a single feature that I’m impressed with. I guess there is good import features that’s about all I’ve seen.
Time has passed , AS3 has been out now for a while now.
Can anyone tell me what you can do in AS3 that you can not do in AS2? What are it’s selling points?
Is it true you can only code on frame one? - what’s that about
From what I’ve see you can do more with AS2 than you can with AS3, and a ton of less issues. True or false? I do not know.
How do you like AS 3? - and why?
Give me good reason to upgrade – in what it can do, that I can’t already do with AS2. I’m not interested in hearing “I’m learning it because that’s where flash is headed.” I need better reason than that. What can it do? And what can’t it do? It seems like there is a whole lot of this.
Is AS3 more restrictive? If so what’s the point of that? Why is functionality downplayed?
Still a lot of Bugs?
Thanks to any that replay.
PS: I don’t see a single thing on that list that i can't do in AS2– if anything the list is comprised of restrictions.
Note: i'm not a fan of Flex or components - don't like them. (i'll give you reasons if you want) mainly that's what scripting is for. I'd rather not have a heavy component, thank you. And i do like to venture out from frame 1 from time to time.
I wish Macromedia was back.
Templarian
June 17th, 2008, 11:43 AM
Video rendering/codecs are a HUGE plus.
3D API's (that supports more than 10 polygons and is easy to use).
Way a way faster drawing API.
You don't have to pay for the Flash IDE (but you sound like your new to programming so you probably want your timeline).
Organization... having a fully OOP structure to work from helps a ton in long projects.
People are treating it as a programming language and more sites are adopting it now as such, so were seeing more useful classes to make things even simpler.
Flash Player 10 is really fun to play with all the new features.
Trust me man the sooner you switch to AS3 the happier you will be in the end. Most of the members here have made the switch and I can say they are far happier for it.
blitzzz
June 17th, 2008, 11:52 AM
Thanks for the responce.
Some good reasons -
But it seems that flash is still along way from a good 3d engine - flash paper is nothing to get excited about.
I think alot of people don't understand the power of the timeline. Esp running many timelines that work with one another. It's very powerful. think about it. to think of all things as moving is the future. I can put a timer on any code/language - multiple visual timelines is what makes flash powerfull. I hope you can understand that.
blitzzz
June 17th, 2008, 11:55 AM
ps: i ment to say papervision. nothing to get excited about.
blitzzz
June 17th, 2008, 12:02 PM
Name any other way i can code 100 timelines to do all differnt things and all work with one another in a matter of a few days. - that's power.
Dj_ouf
June 17th, 2008, 12:03 PM
Hi
A few things certainly usefull :
- Events (inheritance from EventDispatcher class) : now, don't need to create lots of listener objects, simply define a listener function which'll be called.
- Now, a new class came : Sprite. Basically, its the first graphical object level which has interaction events. Like MovieClip but without severals lots of functions and properties mostly not used. So finally very light. In the case of a 3D application with objects fully drawn with API, it will be really faster.
- Library : linkage on bitmap symbols -> export dynamically bitmap from code without creating some of MovieClips.
- Strict typing : really usefull for debugging, when wrong vars
- OOP : overriding, final var, more similar to other OPP language like Java.
- faster flash player virtual machine (the time when 10 movieclips were slowing the player has left)
I think your reaction is tycpically of someone who feels frustrated...like i as before ;p
Frustated from to learn all again...which took so long time.
After learning, i think you'll be
ps : oops soory, didn't noticed there was an answer!
Iamthejuggler
June 17th, 2008, 12:03 PM
"I think alot of people don't understand the power of the timeline. Esp running many timelines that work with one another. It's very powerful. think about it. to think of all things as moving is the future. I can put a timer on any code/language - multiple visual timelines is what makes flash powerfull. I hope you can understand that."
Think of it this way. Using a timeline is allowing time itself to be a restriction on your application. When you ascend to the mentality that frames are not needed you are essentially becoming god, with the power to control the flow of time in whatever crazy way you desire. All moments of time can and sometimes do exist at one point, the now.
On a more serious note, it can be a difficult change in mentality to go from timeline to no timeline, but it is definitely worth it. And you can of course still work with timeline's if you wish.
Gundark
June 17th, 2008, 12:04 PM
Coming from a programmers perspective AS3 is miles and miles ahead of AS2. While non-programmers or beginners may hate the strict typing, lack of _root and _global, etc; for everybody else it's so much better there is just no comparison.
Strict typing saves your butt. Sure there are more errors reported, but that's actually a GOOD thing. No longer will flash fail silently when calling a function whose name you spelled incorrectly. It'll let you know when you are passing the wrong type of thing into a function, it makes working on projects with other people much easier and it allows Flash Player to run much faster.
AS3 uses a completely different Virtual Machine to run on. These "restrictions" as you put it, allow the Flash player to run code often more than 2x as fast.
Also, use Flash Develop. One look at the intellisense you can get and you will never want to use the Flash IDE again.
And to get all of this benefit you don't even have to program using OOP if you don't want to. Although I highly recommend learning it as it's excellent. And all you guys who are getting 3x as much code in AS3 vs AS2 should probably take a look at your design, it shouldn't be that big of a difference.
Of course AS3 isn't perfect, it's still missing some really useful features (function overloading!!!!) but it's a giant leap ahead of AS2.
blitzzz
June 17th, 2008, 12:12 PM
tycpically of someone who feels frustrated..." It might be that way with most, but i have not even tried it. Not even felt the need.
Events (inheritance from EventDispatcher class) : now, don't need to create lots of listener objects, simply define a listener function which'll be called. - can do that with a function in AS2
was just reading about the Library unsure - but I thinks it's just the simple concept of "object referencing" - can do it in AS2. am i wrong? = just set it to a var.
OOP : - will look into ..
Faster ? sounds great - is there proof in the pudding?
Strict typing - i do that on my own.
Gundark
June 17th, 2008, 12:20 PM
As for needing the timeline, no... you really don't. You've got to think about this from a different perspective. Use objects and an event based model instead. Why restrict yourself to only running code on a per frame basis? You could be running code on all kinds of events (not just time-related ones). Each object can be handle all their own functionality (data encasuplation) and your document class can tie it all together.
You wouldn't even need an FLA file.
Putting code on various frames of your main timeline and movieclip's timelines makes your code look like spaghetti. Maybe you aren't working with anybody who has to try and figure out your code, and you have no problem remembering where everything is, but come back in 6 months or a year and try to remember where all your code was hidden.
Classes make it simple and easy to organize your code. Other people can read it and use it easily.
Anyway, AS3 and OOP are very useful but if you don't like them then don't use them. If you're frustrated then take a break and try again later. AS3 is worth learning.
blitzzz
June 17th, 2008, 12:26 PM
I want to thank you all for teh replies thus far. - all logical .. I'll have to prove my theory on the power of timeline code. - will make it my next project -- will keep you posted even if i'm wrong - or you can prove me wrong. As for working alone - you are correct .. :)
blitzzz
June 17th, 2008, 12:28 PM
PS: the power is when there are massive amounts of timelines to work with that would be impossible any other way.. - with out years of coding.
Gundark
June 17th, 2008, 12:33 PM
Developing in AS3 doesn't stop you from putting code onto the timeline. I dunno who told you could only put code in the first frame but they are wrong. You can still put code onto whatever frame you want in the main timeline and in separate movieclip timelines.
You cannot however put code inside of components anymore.
I don't use this method myself, as I think OOP is much better but AS3 doesn't stop you from doing it.
So don't let that stop you from learning AS3.
blitzzz
June 17th, 2008, 01:21 PM
AS3 uses a completely different Virtual Machine to run on. These "restrictions" as you put it, allow the Flash player to run code often more than 2x as fast.
ahh.. i see.
what's up with " Iamthejuggler " -- lol . I'm out gunned here.
Templarian
June 17th, 2008, 01:25 PM
^Yes you are... hehe.
@Gundark, Well said, I think he was getting a bit misguided in his research.
Just start learning and you will begin to love adobe and all the changes they have made. Plus they constantly add stuff that developers ask for in each CS release.
If you have any questions just ask all, the basic questions get answered very quickly around here.
blitzzz
June 17th, 2008, 01:29 PM
Trust me man the sooner you switch to AS3 the happier you will be in the end.
I'm going to trust you templar.. And i should not have downplayed your comments - any step foward with 3d is great. _
yea .. you guys have alot of folk around here. :)
blitzzz
June 17th, 2008, 01:32 PM
all good posts .. TY guys.. will be back, can't tell you have much i've learned from this site (over the years) - even though i never logged in..
blitzzz
June 17th, 2008, 01:48 PM
i'll choose to get on the buss instead of watch it go by. -better a bit late then never ...
out..
Iamthejuggler
June 17th, 2008, 01:52 PM
ahh.. i see.
what's up with " Iamthejuggler " -- lol . I'm out gunned here.
Haha. I had just come out of a fairly intense meeting. My mind wasn't quite working as it usually does! Feet are firmly back on terra firma now. Glad to hear you are gonna give AS3 a go. :)
blitzzz
June 17th, 2008, 02:08 PM
thanks for the schooling - PS: - Dom Scripting is my specialty - youWillBeTheJuggler if i want.
Iamthejuggler
June 17th, 2008, 02:11 PM
ooh 'eck!
Gundark
June 17th, 2008, 02:12 PM
Glad to hear you're gonna try it out. Try not to get frustrated by all the differences, you'll get to liking them eventually.
It's always good try and learn new things, otherwise you could end up in a government basement somewhere programming fortran.
Take a look at OOP too, don't expect to immediately be able to pick it up; just keep on learning.
dthought
June 17th, 2008, 07:53 PM
Not sure why you think having Macromedia back would be any different. Flash 9 was already under development when the Adobe merger happened.
The speed increases from the AVM2 alone are worth learning AS3.
Also, strict typecasting in AS2 is half-hearted - it only does typecasting at compile time. Once Flash is running, it doesn't store any typecasting information and so is not as robust. AS3 always remembers what types it is dealing with which means that whilst it can throw more errors at you, in the end you will write better code :)
You can now also create MovieClips with var myClip:MovieClip = new MovieClip(); - no more fudging around with things like attachMovie or createEmptyMovieClip. Also, the new display list kicks ten shades of heck out of the old depth stacking system.
Anyway, anything you can do in AS2 you can do better, faster and ten times more awesome in AS3.
blitzzz
June 17th, 2008, 09:58 PM
Now that’s selling. TY- is what I’m wanting to hear.
Back to the timeline thought – an advantage of being able to put code on any frame is progressive download and execution by frame. This is a huge deal to me alone. I have other reasons that I know in my head that would be very tuff to explain, and even hard for me to conceptualize in being advantageous to mathematics (always seems to be a way). But I believe it to be functional when dealing with graphical interlocking elements, with variable timeline length that take “human sight” to construct. ? :sen:?
I don’t mind someone taking away code put directly on objects, I’ve learned that frame code is better , but the only “frame one” thing had me rejecting it no matter what – note: it turns out I was misinformed.
blitzzz
June 17th, 2008, 10:42 PM
Try not to get frustrated by all the differences, you'll get to liking them eventually.
sounds like it's a common thing.. will do.. thanks for all the warnings. It will help.
i've heard enough. .. ty all
can't be harder than taking classes in ColdFusion, PHP, .NET C# all at the same time. with no developer exp.
now that was Con-Fuse-Ing.. took a year to see straight.
misterooga
June 19th, 2008, 12:00 PM
I am actually thinking about downgrading. :)
I haven't really used AS3 that much but I wanted to develop a flash game that will play on Opera for wii-internet... and Flash7/AS2 seems to be the only way to go for now.
Rather disappointing since I thought I finally figured out AS3 with my last project...
Incrue
June 22nd, 2008, 02:28 PM
about as3 (http://http://board.flashkit.com/board/showthread.php?t=760865&page=3)
I totally agree with tom, while the direction of evolution on everything on earth goes to increase productivity, the adobe nerds make flash goes the oposite way.
The thing is Adobe guys seem to not have realized how things work in the retail pc game/console game world, that many creative people use less low level creation ways to create their visions and arenīt less professionals because of that, for Adobe now professional developers all like to code in lower level oop manners closer and closer getting to the system to get max performance and thatīs what theyīll go for and they wonīt change that until a big enough part of their userbase moans publically about this.
Also, if you are into games them the greatest benefit from as3 would be 3d, but 3d in flash is still very poor, compared to what could be done in director, for example, 10 years ago.They are impressive from flash limits but the players dont care what are the flash limits.Decent 3d for them is nothing new
sekasi
June 22nd, 2008, 02:34 PM
Anyway, anything you can do in AS2 you can do better, faster and ten times more awesome in AS3.
dunno about faster : P everything requires 2x the amount of typing! : )
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.