dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: AS2 or AS3 - Big Decision

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    30

    AS2 or AS3 - Big Decision

    hy

    before i commit my self to my big project...i want to find out what will be better to use AS2 or AS3, i am more comfortable with AS2 but AS3 is a powerful and performs actions much quicker, however simple things in AS2 like Key.isDown has been transformed to much harder EventListner Functions, also senior members on this forum perfer using AS2 rather than AS3.

    The game will be like a fighting game, similar to street fighter and tekken games, there will be loads of different characters and different moves, also the user can select different armours and sword, move sets, e.g. a character can equip a fire move set, armours and fire sword....so which should i use AS2 or AS3?

  2. #2
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    It really comes down to what you're more comfortable with, or if you want this project to be a learning experience for you to become comfortable with AS3. You can easily create a custom Key class that acts like the AS2 Key class. I can even pop you one of mine over. It's pretty basic, but useful and much cleaner for coding.

    With AS3, you'll just need to get used to being organized with classes, and when to make a class for something, stuff like that. You really can't afford to be not organized with AS3, from my experience at least.

    I'm a believer in AS3 now, though many people still do use AS2...

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  3. #3
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,379
    I liked AS2 because it was such a fun, non-strict coding environment. I never bothered with AS3 because it was too much like work. There's my two cents.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  4. #4
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,140
    you can still work on the timeline in AS3, you never need to create a class at all. You can even uncheck strict and warnings mode in the compiler options. Meaning you don't even need to be type safe.

    use AS3. The event stuff is cumbersome at first, but after a while it begins to make more sense and is very powerful.
    lather yourself up with soap - soap arcade

  5. #5
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    next to those things the others talked about you should also consider how you want to set up your game on art side some. If youŽre fine with doing things more on code side, have relatively "flat" Sprite or Movieclip hierarchies or do most with BitmapData, AS3 is ok for that, too, but if you have a setup where you have lots of seperate swfs and/or lots of deep nested movieclips you want to control seperately that can end up to be pretty cumbersome to do in as3.
    To generalize it a bit to sum it up: AS3 is usually better for structuring code, creating big reusable frameworks, several coders working together on a project and things that require more performance on code execution side, AS1/2 is usually quicker and less cumbersome to implement without creating wrapper classes and allows more flexible usage of the timeline and more flexible media access and control in general (excluding ByteArray stuff which is only available in AS3 thanks to AdobeŽs laziness butusually not used in games a lot anyway).

    Rereading your post regarding the fighting game side: IŽd suggest you go with AS2 as with a fighting game like that AS2 can handle that fine regarding code execution performance, too and in a game like that youŽd probably get annoyed with how you have to control the seperate fighter parts movieclips in AS3 (unless you intend to handle your fighters as Bitmapdata using big spritesheeets instead of setting them up in movieclips).
    Last edited by tomsamson; 08-13-2009 at 04:25 AM.

  6. #6
    Member
    Join Date
    Jun 2009
    Posts
    30
    thanks for all the replies, just on the graphics side, i will want Movieclip hierarchies, e.g. the main movieclip would be the character, then within that would be the head movieclip and within that there will be a graphic for the skin colour, so that the user can change the colour of the skin, allowing for customisable character...also i was think of having seperate swfs, which will be loaded by the main swf, i could do this in AS3 using the URLRequest or in AS2 using MovieClipLoader.

    I was thinking that i may expand afterwards i.e. making different zones where the character can travel...if i was to hand this to another coder it may be better to do it in AS3 right?

    would it not be possible to write a 'universal' class in AS3 which will have the basics for all the classes like where to place the hand, head movieclips on stage and apply it to the different characters but extend on it, to make it individual?

  7. #7
    Senior Member hatu's Avatar
    Join Date
    Jan 2007
    Posts
    480
    Quote Originally Posted by tomsamson View Post
    next to those things the others talked about you should also consider how you want to set up your game on art side some. If youŽre fine with doing things more on code side, have relatively "flat" Sprite or Movieclip hierarchies or do most with BitmapData, AS3 is ok for that, too, but if you have a setup where you have lots of seperate swfs and/or lots of deep nested movieclips you want to control seperately that can end up to be pretty cumbersome to do in as3.
    I'm not sure if I understand how it's any better in AS2. You still control nested MovieClips in pretty much exactly the same way.
    character.head.gotoAndStop("smile");

    Unless you're talking about code inside nested movieclips then I don't even wanna go there.
    http://hatu.biz
    Portfolio & games

  8. #8
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    If you're going to be using the timeline heavily, and you go with AS3, make sure you publish to FP10 - there were a lot of timeline fixes in FP10 that made the timeline a nightmare for AS3 in FP9.

  9. #9
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    hatu: you canŽt access nested movieclips from outside before their init event has thrown.
    Next up like senocular said with FP9 there were quite some big bugs related to AS3 and movieclip control (many memory leakage related, for example clips not being there on the timeline anymore still being there in memory etc). At least some of those (still not all of em at all) have been fixed with FP 10.
    I ssuggest if you do a lot with nested timelines/movieclips/swfs just donŽt go with AS3.
    Last edited by tomsamson; 08-16-2009 at 11:05 AM.

  10. #10
    Senior Member
    Join Date
    Nov 2005
    Posts
    192
    Quote Originally Posted by JT1 View Post
    hy

    before i commit my self to my big project...i want to find out what will be better to use AS2 or AS3, i am more comfortable with AS2 but AS3 is a powerful and performs actions much quicker, however simple things in AS2 like Key.isDown has been transformed to much harder EventListner Functions, also senior members on this forum perfer using AS2 rather than AS3.

    The game will be like a fighting game, similar to street fighter and tekken games, there will be loads of different characters and different moves, also the user can select different armours and sword, move sets, e.g. a character can equip a fire move set, armours and fire sword....so which should i use AS2 or AS3?
    Quote Originally Posted by Pazil View Post
    It really comes down to what you're more comfortable with, or if you want this project to be a learning experience for you to become comfortable with AS3. You can easily create a custom Key class that acts like the AS2 Key class. I can even pop you one of mine over. It's pretty basic, but useful and much cleaner for coding.

    P.

    Don't need to make your own key class especially if he is new to as3. This is what I use and pretty much replicates Key.isDown/ Key.isUp

    http://code.google.com/p/bigroom/wiki/KeyPoll

    I don't think anyone should be starting any new projects in AS2 to be honest. If you have something small leftover in as2, should just scrap it and rewrite in as3.

    Flex builder 3 is probably one of the best flash development tools, and if you decide to use to as3, you should get it or perhaps the free flex sdk if you can't. I wish I had tried it earlier because it saves a lot of time compiling, the memory profiler is very helpful, and the auto complete is much better than the flash IDE. Flash didn't autocomplete stuff for custom classes, only its own. Flex will have autocomplete for anything you import.

    For starting in as3, here are some general guidelines:
    Use only one EnterFrame Event.

    Type everything(var s:String = "name", NOT var s = "name"), especially when using arrays. It will speed up the code and let you use autocomplete.

    Since the _root is gone, you can either implement a pseudo version of it or just use static / singleton classes.


    When I started out in As3, I had trouble communicating between my various classes, just use a good hierarchy and plan out your class structure before you start coding. http://www.rivermanmedia.com/feature...e-scene-system

  11. #11
    Flash Intermediate XenElement's Avatar
    Join Date
    Sep 2008
    Location
    At my computer
    Posts
    196
    I think the general best option is AS3, because it is Object Oriented. This opens you up to A LOT more cool things, and is in general more organized.

    I think the best thing a bout AS3 is definitely going to be the fact that it is much closer to C.

    AS2 is pretty much unique to flash, (I've never seen another language with key.isDown)

    If you use AS3 then you can use other code snippets and Ideas that aren't just in flash. You may have to recode them a bit, but AS3 is much closer to what real program development languages use (remember, flash was originally for online video).


    That's just my thoughts, By the way, I was an AS2-er for a while, and finding code inside MCs is a pain. Use OOP AS3 and you'll be happy.
    In the process of designing a quirky little game engine called gulp. Check out it's progress below: @ my blog.

    ---

    Check out my blog at XenElement.com

  12. #12
    Zombie Coder EvilKris's Avatar
    Join Date
    Jun 2006
    Location
    Fukuoka, Japan.
    Posts
    796
    if you're going to use nested movieclips there are tricks you can use such as having a blank mc in the frames where the animation is empty. And name it with the same reference name.

    So say I have one layer with all my frames on it, but only on frame 5 does the attack animation (instance name: kick_mc) on another layer. Then for frames 1-4 ill need to have an empty mc and also name it kick_mc. That way you can still reference it via character.head.gotoAndStop("smile"); only you'll have to be careful you only try to do whatever you want when it's at the proper frame. Bit of a crappy workaround but I've done it once or twice.

    I've concluded it's best to keep every frame on the same timeline. Then what you can do is an array containing objects (info) for each 'move'. ie. punch{start:5, finish:50, attack_power:10, sfx: hit_wav, held_down:false}
    start being the first frame, and finish the last frame of that animation.

    Gives you a lot more control than AS2 in the end actually. People are right, AS3 is a hundred times better than AS2, it's just the learning curve is a bit of a hurdle.
    Wait till I get my latest game out, (in a week or so) after that I plan to write some easy AS3 tutes for fighting games.

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