A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 37

Thread: How can you deal with as3?

  1. #1
    Member
    Join Date
    Sep 2008
    Posts
    40

    Question How can you deal with as3?

    I'm looking at the as2 to as3 migration cheatsheet and see that all my favorite and most used codes have been removed. So my question is how would we do without some of the necessities like attach/remove movie clips? Is this chart not finished or am I missing something? And I've noticed that all the codes are much longer. Sometimes I wish Macromedia could have written as3 before adobe took over and beat the hell out of it. Then again some people say it can do a lot more than as2.

  2. #2
    Senior Member
    Join Date
    Feb 2004
    Posts
    782
    Well, AS3 contains alot of import and references that didn't exist in AS2. They got rid of easy to use functions like getURL also.

    The main advantage to AS3 is speed.

    Basically many people have taken the path using using AS3 for Box2d and games with thousands upon thousands of particles and AS2 for everything else.

    For simple or even moderate complex games, there's not much reason to use AS3 unless your dealing with the multiplayer aspect.
    Flash Ninja Clan - Games and cartoons

  3. #3
    Member
    Join Date
    Sep 2008
    Posts
    40
    Well how is multiplayer easier? Does it have more complex xml?

  4. #4
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    there's (almost) nothing you can do in AS2 that you can't in AS3. you said something about not have attach/remove movie clip... those still exist, just in different form. to attach a movie clip from the library to the stage, you give it a class name, then:
    PHP Code:
    var someInstance:SomeClass = new SomeClass();
    addChild(someInstance); 
    to remove it
    PHP Code:
    someInstance.parent.removeChild(someInstance); 
    for simple things, AS3 does tend to be more verbose. and i do miss the AS2 TextField.variable property, and prototype in AS3 is kind of goofy (if you attach methods directly to the prototype object, the local vars get scoped globally - you have to declar it as a function then add it to the prototype object as a reference.) that said, AS3 is significantly faster and has a lot of features that AS2 did not (Regular Expressions and E4X type XML-traversal are very handy).

  5. #5
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    Another one of these threads... Ugh.

  6. #6
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Sometimes I wish Macromedia could have written as3 before adobe took over and beat the hell out of it.
    I wished Macromedia did a lot of things they didn't but I certainly wouldn't accuse Adobe of beating the hell out of anything but Macromedia's lackadaisical development schedule. Adobe has taken the platform (not only Flash but all AS3 based platforms they encompass) to new heights IMO.

    If you like AS2, code with it. Same for AS1. If you choose not to follow the path Adobe has taken the language...it's your call. There are no guns to any heads to migrate. You will however not be riding the leading edge, will not be current and will find yourself in a few years time as deprecated as the syntax you've bound yourself to.

    This many years into AS3, the question isn't should you or shouldn't you migrate but rather what in gods name are you waiting for?

  7. #7
    Member
    Join Date
    Sep 2008
    Posts
    40
    Quote Originally Posted by MyFriendIsATaco View Post
    Another one of these threads... Ugh.
    oops sorry

  8. #8
    Member
    Join Date
    Sep 2008
    Posts
    40
    Quote Originally Posted by Chris_Seahorn View Post
    I wished Macromedia did a lot of things they didn't but I certainly wouldn't accuse Adobe of beating the hell out of anything but Macromedia's lackadaisical development schedule. Adobe has taken the platform (not only Flash but all AS3 based platforms they encompass) to new heights IMO.

    If you like AS2, code with it. Same for AS1. If you choose not to follow the path Adobe has taken the language...it's your call. There are no guns to any heads to migrate. You will however not be riding the leading edge, will not be current and will find yourself in a few years time as deprecated as the syntax you've bound yourself to.

    This many years into AS3, the question isn't should you or shouldn't you migrate but rather what in gods name are you waiting for?
    by beating the hell out of it i ment they changed the language so much that it's hard for users to migrate. as2 is, let's face it probably one of the easiest languages to learn, or at least understand. People completely new to as2 can read the code and understand most of it unless it's something based on math or xml. that's why i liked as2, because it's so simple yet it's got some useful functions in it. as3 just isn't as easy to read for newer people, that's my point.

  9. #9
    Senior Member
    Join Date
    Feb 2004
    Posts
    782
    AS2 is akin to PHP in ease to learn. You'll notice that languages like ASP.NET, Ruby, etc have failed to obsolete PHP because so many more people start with PHP because its so much easier to learn.

    AS2 will always be more popular than AS3 among the general populace for the same reason.

    Asa for multiplayer, many people have mentioned it handles data packets better.

    Chris, most people haven't migrated.

    One of the main reasons is because of the lack of tutorials and resources. There's a not lot of those "how to make this shooting game" or "how to make a tower defense game step by step". The problem is "professional" developers don't like writing those types of tutorials but would rather tell you to learn "how to think". Thats not going to prompt alot of people to latch onto AS3.

    Besides, most flash content is animations more than games. There's absolutely no reason for those people to switch from AS2 to AS3 and being able to put 2 lines in movieclips themselves is a big thing that was taken away in AS3.

    I'm looking forward to further Swish development. They've taken a different approach than adobe completely. Instead of making thing more powerful but harder to use, they've made things easier for most people to make good stuff. The software pretty cheap too compared to the flash IDE.

    If adobe continues on this route, they'll probably gain some professionals but lose a lot of the hobbyists to someone new who creates a development language more like AS2. Its just like ASP.NET when compared to PHP. ASP.NET is favored by corporations but PHP is heavily favored online.
    Last edited by Archbob; 05-25-2009 at 03:34 PM.
    Flash Ninja Clan - Games and cartoons

  10. #10
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Quote Originally Posted by antidrag View Post
    as2 is, let's face it probably one of the easiest languages to learn, or at least understand.

    No. Consider this in AS2:

    PHP Code:
    stage.createEmptyMovieClip();
    stage.attachMovie();
    stage.attachVideo();
    stage.createTextField();
    stage.attachBitmap(); 
    The action here is the same - you want to make new objects. Why are there totally different keywords for these? Why not createEmptyBitmap or attachTextField? And why is it attachMovie, when you're attaching a MovieCLIP? There's no consistency.

    In AS3:

    PHP Code:
    addChild(new MovieClip());
    addChild(new VideoPlayer());
    addChild(new TextField());
    addChild(new Bitmap()); 
    The reason it's different is because Macromedia bolted new features onto the language with every release without updating the old stuff or limiting the new stuff to stay consistent. In as3 they rewrote the whole mess to be modular and clearly defined. If you want something out of the library, you just give it a class - say MyCrazyGraphic, then use the same syntax as everything else: new MyCrazyGraphic(), and you can add it and manipulate it the same as everything else.

    AS3 absolutely is different and there will be stumbling points, but if you take the time to learn the theory (eg. the display list and the event model) it makes a lot more sense than 2.


    Also @Archbob: Remember that AS2 has been around for half a decade now and AS3 is only a couple years old. Lifespans aside, I challenge you to find any other dev community with more tutorials or camaraderie.

  11. #11
    Senior Member
    Join Date
    Feb 2004
    Posts
    782
    camaraderie, maybe.

    Tutorials and resources, AS3 severely lacks, even given its age.

    Most all tutorials I've seen in AS3 are general concept tutorials not "how to do this specific task" tutorials, which more people look for.

    I guess when I talk about AS2, I talk more about the AS1 style of coding where you can put code into the movie clips themselves as in

    Code:
    onClipEvent(load)
    {
    
    }
    
    and 
    
    onClipEvent(enterFrame)
    {
    
    }
    "Professionals" detest it, but it makes so much sense. They don't quite realize that their high touted object model and OO style is generally incomprehensible to someone who is wanting to start out in flash.

    Your example isn't really that good because:

    Code:
    addChild(new MovieClip());
    addChild(new VideoPlayer());
    addChild(new TextField());
    addChild(new Bitmap());
    Generally doesn't work in itself, you have to put in into a class or .as file or in another class whereas the attach code from AS2 will work stand-alone. The overhead is confusing for new people as well as those imports you have to put at the top.

    AS2 tutorials on how to do specific tasks sprung up each faster than AS3's have been.

    AS3 just doesn't have the appeal to the general populace as AS2 does. It appeals to one specific group of people -- professional developers(and people who only use flashdevelop instead of the IDE).
    Last edited by Archbob; 05-25-2009 at 03:57 PM.
    Flash Ninja Clan - Games and cartoons

  12. #12
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I understood the original question to be "How can you deal with AS3?". Maybe it is easier for the hobbiest to stay stagnant than the professional but with the cost of these platforms I would offer that they are designed and geared toward the professional in the first place and embraced by the hobbiest as an afterthought or simply by attrition.

    I have yet to be approached for nearly a year with anything but AS3 based clients so whether I love AS1/2 or not (which i did), I simply cant make a dime with it these days in the area of coding I target (dynamic data based systems). I didn't migrate because I hated AS1/2....I migrated because I couldn't compete unless I did.

    If you can sustain yourself (be you game programmer, hobbiest or whatever) holding firm to earlier versions or if you have not migrated for reasons of lack of example code or tutorials (which I BTW disagree on there being a lack of) than it has little to do with the original question as you do not "Have to deal with AS3" if you dont want to. You only have to if you want to stay current and you deal with it because you cant have one without the other

  13. #13
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Had to dig around all over the place to find it but I finally found Moock's article addressing this issue: http://www.insideria.com/2008/01/act...t-hard-or.html

  14. #14
    Member
    Join Date
    Sep 2008
    Posts
    40
    Quote Originally Posted by neznein9 View Post
    Had to dig around all over the place to find it but I finally found Moock's article addressing this issue: http://www.insideria.com/2008/01/act...t-hard-or.html
    You guys should be a better judge than me since you've been around the code more. Doesn't it look like he found the simplest as3 codes possible in the first few examples? Maybe it's just me.

  15. #15
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    I just migrated form AS 2.0 to 3.0 and got up and running in about 2 weeks....Thats not a bad turnaround time and I'm looking forward to working with the new features introduced with the AS 3.0 programming language....I also really like the modular aspect to AS 3.0 because i can build a bunch of classes and then rearrange those classes to provide functionality that i hadn't thought of before.
    ~calmchess~

  16. #16
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    I don't think AS3 was created with the intentions of replacing AS2. It should be used in conjunction. Both versions satisfy completely different groups of people.

    AS3 is welcoming for programmers like myself. I had SOOO many issues with AS2 trying to write REAL applications and more complex projects.

    AS2 is for people like you. People who aren't ready for that real leap into programming. It's also used for designers and animators who need basic interactivity.

    I don't personally see AS2 going away any time soon. It has its market, and will for a long time. And the Flash Player is backwards compatible. So even when Actionscript 5 is out, and we're using Flash Player v20, it's still going to play movies compiled in Actionscript 2, for Flash Player 6.

    Nobody is forcing you to learn Actionscript 3. If you were a hardcore programmer, you wouldn't need to be told these things and argue the welcoming additions to the language. If you are, you need to learn to embrace these things or you won't make it far.

    And lastly, you're right about tutorials. Higher level programming isn't so much "here's exactly how to do it" because that's not what programming is about. Programming is logic and problem solving wrapped up in some weird language. Once you know the syntax and the basics, everything is easy from there. For any language. That's why most programmers know several languages and easily pick up new ones. The concepts and logic is what's more important. If I look how to solve a problem, I don't care about his solution per-say. I want to know mentally how to achieve that goal, then implement that into my own project. Things are not very black and white with code. There's always at least 10 ways to do the exact same thing. You just have to know which method is the best for the current situation.

    [/rant]

  17. #17
    Senior Member
    Join Date
    Feb 2004
    Posts
    782
    Mainly for me its getting the hang of which code does what. I've done Actionscript, PHP, some Java, and C++ and I like AS 1/ AS2 the best because its really easy to pick up and you can do all the logic with it you can with the other languages. I've never really liked the modular stuff in any of the languages. organitionally(for games in flash, which is what I do), it so much easier for everything to be on one file and one frame(or in a few movie clips) than in 50 different .AS files. Keep in mind, I use the IDE and not flash develop.

    Stuff like Box2d and games with a lot (I'm talking tens of thousands) of clips on the stage, I have to use AS3 for because of the speed. But for the rest of my games and animations, I don't really see any reason at all to migrate over.

    The primary reason I'm sticking with the AS1/AS2 coding for most things because AS3 takes away the ability to put code in the clips themselves.

    Those examples are pretty bad in that. Take to navigate to example. That doesn't work by itself without an import at the top. In general you would do something like this inside a .AS for getURL in AS2(not you still have to import at the top):

    Code:
    			
    var request:URLRequest = new URLRequest("your url here");
    navigateToURL(request, '_blank');
    Each version of AS has its purpose. As for popularity among the general populace, I don't see AS3 every overtaking AS2.
    Last edited by Archbob; 05-25-2009 at 11:43 PM.
    Flash Ninja Clan - Games and cartoons

  18. #18
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    Apparently you're not seeing the advantages of using separate files for everything, but I will agree that the imports can become tedious. But for you, developing in the IDE, MOST classes don't need imported.

    Putting code on clips is about the messiest thing you can do. Go ahead and hand off your application to some other developer and watch them cry trying to modify something.

    For the record, I don't use FlashDevelop either, but I sure has hell don't use the IDE.

    I think you're just more stubborn to the modularity and OO aspects. If you really want to become an efficient programmer, I'd suggest taking the time to actually study a bit of OO concepts. If you want something specific to AS2, pick up the book Essential Actionscript 2.0. It was a big stepping stone for me entering into OO stuff. Once you figure out the concepts behind it, you'll quickly realize where AS2 has fallen short in the implementations and AS3 shines.

    But if you want to stick with your basics, by all means, do it. Just don't complain about AS3 and flood these boards with your mindless whining and complaining. It's extremely unwelcoming to new AS3 users who actually want to learn it.

  19. #19
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    When AS3 came out I had just finished coding a six-month project, a multi-franchise reservations and accounting software in AS2. Before undertaking it, I'd urged the client to wait until the beta release of Flash 9 so it could be done in the new language, but they were in a hurry. When Flash 9 came out it took me a month -- a solid month -- of messing with it every day before I felt comfortable offering my services to clients in the new language. But now, it's so comfortable to me, and so much more logical, that it's incredibly hard to dive into the 75,000+ lines of AS2 code I wrote for that reservations software and make the necessary updates. It's utter hell every time I have to look at the thing.

    This is not the difference between PHP and ASP. This is a much-needed consolidation and simplification along the lines of upgrading from PHP4 to 5.x ... yes, it breaks your old code, especially when you coded lazily or didn't know what you're doing, but the world moves on and hopefully as it does, you change and grow and become a more knowledgeable and more adept person, whatever your job is. Decrying the change at this point is kind of like bemoaning the death of John Henry. Or wearing a G&R t-shirt every time you go to a show. Because...Axl...Rocks. Yeah. But dude, get over it. He's old. And if you took the time to learn sumthing since 1989, you'd get why the world's moved on and gotten over it, too. And on a philosophical level, I'm by no means saying that whatever the majority fixes on is the best way to go. But you wouldn't get in a race with an '82 Mustang unless you had some serious hangups, so let's be realistic; change with the times or get outta the way.

  20. #20
    Senior Member
    Join Date
    Feb 2004
    Posts
    782
    It depends, for easy things, its just faster to code things in AS2 than 3.You have say what you want about the simplicity, but there's just a lack of resources for it at this moment and it is a lot more verbose.

    I don't find putting code in clips messy at all. Putting it all in the first frame is ok for me also. The "search and find function" is far more efficient if its in one place rather than in 50 seperate files. Its especially true if you use the IDE and really doesn't apply if you use flashdevelop.

    PHP5 was great because it was almost 100% compatible with PHP4, which is something AS3 fails at. Look even at most PHP applications and code people write now in PHP, the vast majority of it is still in the old style. If you broke compatibility, PHP 5 installations would never be as widespread as they are now.

    This is really not about the world moving on or things getting better. AS3 Generally tailors itself to professional programmers, AS2 tailors itself better to Hobbyists.

    It depends which audience you want to cater to more professionals or hobbyists.

    When most newbies come to the board, they always ask whether they should start with AS2 or 3. Most go with 2 because they want to be able to make a certain types of game and just about every type if game is covered by an AS2 tutorial step-by-step while there are very few in AS3. Most of tutorials and code examples that do exist for AS3 don't work out of the box either mainly because the writer of the example or tutorial forgot to import or didn't package something right. That what turns most newcomers off from AS3.

    Tutorials like http://www.towerdefence.net/forum/tu...wer-t3615.html would go a great way to bring casual hobbyists into AS3, but those are just lacking.
    Last edited by Archbob; 05-26-2009 at 01:32 AM.
    Flash Ninja Clan - Games and cartoons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center