11 Replies Latest reply on May 19, 2010 9:10 AM by Tony Heagren

    actionscript 2.0 vs actionscript 3.0

    Level 7
      I have been writing shooting games with AS2.
      Here http://livedocs.adobe.com/flex/2/langref/migration.html they list
      differences and it looks like AS3 is a completely different beast.
      Is there any point to spend time on learning AS3? Does it offer any
      advantage in terms of speed and functionality? Does it allow to do something
      quiker and more efficient then AS2?



        • 1. Re: actionscript 2.0 vs actionscript 3.0
          kglad Adobe Community Professional & MVP
          yes, it offers significant advantages in terms of speed and there is an increase in functionality (but i wouldn't know if any of the latter would matter to you).
          • 2. Re: actionscript 2.0 vs actionscript 3.0
            Level 7
            aa,

            > it looks like AS3 is a completely different beast [from AS2].

            Yes and no. In a number of places, the syntax has changed (event
            handling comes to mind), but on the other hand, the principles are basically
            the same. It has been said AS3 is "evolutionary, not revolutionary," and I
            agree with that.

            > Is there any point to spend time on learning AS3?

            Of course! As time goes by, more and more people will be coding in AS3
            simply because it's the current standard, just as more and more people
            started coding in AS2 when that version of the language was new on the
            scene. That said, I think it's equally valuable to keep up your AS2 skills,
            because that gives you greater flexibility in serving clients' needs. I'm
            still asked to produce content for Flash Player 8 and lower, which means AS3
            is out of the question. But I enjoy using AS3 when I can because it's
            considerably more internally consistant.

            My favorite example of this -- because it's brief and easy to grasp --
            is event handling. In AS2, you can handle events in any of the following
            ways: a) by attaching on() and/or onClipEvent() functions directly to an
            object, such as a button symbol; b) by using the dot notation equivalent of
            those functions (myButton.onRelease = function(){}); c) by using
            addListener(), or d) by using addEventListener(). That's a handful of ways
            to accomplish the same thing, and they're not all interchangeable. You have
            to know which objects support which approach, which takes a level of
            interest/research and a good memory. Some work with components, some with
            special-case classes like Mouse, Key, and so on, and some work with more
            common everyday classes like Button, MovieClip, TextField, and the like.

            In contrast, AS3 consolidates those numerous approaches to a single,
            consistent mechanism: addEventListener() (* this is true in nearly all
            cases; there are a few exceptions in video-related classes). So if you're
            an AS3 newcomer, all you have to learn is how to wire up events using
            addEventListener(), and you're good to go. If you're a newcomer to AS2, you
            have a lot more to learn. Fortunately, if you're already comfortable with
            AS2, you'll find that you already have a leg up, because addEventListener()
            already exists for some AS2 scenarios ... so you simply have to tweak your
            understanding of the syntax a bit.

            > Does [AS3] offer any advantage in terms of speed and
            > functionality? Does it allow to do something quiker and
            > more efficient then AS2?

            Yes, to all of the above, but you may not notice speed increases unless
            your application does significant number crunching. To illustrate this
            point in a recent book I co-authored (The ActionScript 3.0 Quick Reference
            Guide [O'Reilly]), I used a version of some code written by kglad (another
            regular on these forums) that draws the Mandelbrot set in Flash. To be
            sure, drawing fractals requires number crunching, and AS3 provides a
            noticeable speed increase over the AS2 version. I also see this increase in
            scenarios like ActionScript-based QuickTime VR alternatives, where lots of
            bitmap pixels are being repositioned and warped at runtime.

            So unless you're planning to program that sort of application, the speed
            increase you're more likely to see -- once you get over the migration
            hump -- is a boost in productivity and workflow. But again, you'll have to
            "pay" for that at first with the time it takes you to get used to the new
            syntax.


            David Stiller
            Co-author, Foundation Flash CS4 for Designers
            http://tinyurl.com/5j55cv
            "Luck is the residue of good design."


            • 3. Re: actionscript 2.0 vs actionscript 3.0
              siddarath

              how to create a flash shooting games

              • 4. Re: actionscript 2.0 vs actionscript 3.0
                siddarath Level 1

                how to create flash shooting game

                • 5. Re: actionscript 2.0 vs actionscript 3.0
                  siddarath Level 1

                  how to create a flash shooting games

                  • 6. Re: actionscript 2.0 vs actionscript 3.0
                    kglad Adobe Community Professional & MVP

                    learn actionscript, learn actionscript, learn actionscript.

                    • 7. Re: actionscript 2.0 vs actionscript 3.0
                      siddarath Level 1

                      almost i have finished the games but i dont know how to create health level and how to keep enemy to fire

                      • 8. Re: actionscript 2.0 vs actionscript 3.0
                        Harry Kunz Level 4

                        You should create a new thread and try to be more specific by presenting some code snippets you have problems with.

                        • 9. Re: actionscript 2.0 vs actionscript 3.0
                          siddarath Level 1

                          pls give me some flash shooting games templates tat may help me

                          • 10. Re: actionscript 2.0 vs actionscript 3.0
                            siddarath Level 1

                            how to create login form in flashcs3 getting name and email id values

                            • 11. Re: actionscript 2.0 vs actionscript 3.0
                              Tony Heagren Level 1

                              You'll save yourself a lot of time and effort if you build a simple flash front end and use php to process it.

                              More secure too...