dcsimg
A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 42

Thread: is AS3 actaully worth the effort?

  1. #1
    Member
    Join Date
    Jan 2004
    Location
    England
    Posts
    87

    Question is AS3 actaully worth the effort?

    Hi guys

    Hope I don't get everyone angry by posting this, but is ActionScript 3.0 really worth the effort? I recently embarked on a project to make a new game using AS3 but to be honest I fell at the first hurdle trying to do tasks that were very simple in AS2.

    What are the actual advantages of using AS3, other than the greater power and efficiency? It just seems to me coming up from AS2 that its much more difficult for a developer to do things in AS3 (e.g. access variables in movie clips) than it was in AS2. I know that particular example has been covered before, but all this stuff about declaring this and that I really can't be bothered with. I want to access a variable, and i want to do it now.

    Or have I missed the point?

    regards,
    j

    my code is crap

  2. #2
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    Simply put: Yes, it's worth the effort. Why ? Try reading up on the differences between AS 2 and AS 3, see what AS 3 can offer that AS 2 can't, and so on. Some used to say that AS 2.0 was OOP, but actually, it was quite far from being OOP, well now, AS 3.0 is truly OOP ( it could be better, but compared to AS 2.0, well, it's simply light years ahead of AS 2.0 ). IMHO, it's simply different and not more complex.
    Last edited by fx.barrett; 01-07-2008 at 04:49 PM.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  3. #3
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    I think you have missed the point. It's not that things are harder or more complex, it's just different. The things that may seem a little more complex to you are only because the same exact thing is handled in a different way.

    Take event listeners as an example. In as2, you'd do something like:

    btn.onRelease = function():Void { /*blah blah */ };

    and in as3, it is:

    btn.addEventListener(MouseEvent.CLICK, clickBtn);
    function clickBtn($e:MouseEvent):void
    {
    //
    }

    Event listeners have many advantages over built in functions like onRelease. For example, many different objects can listen for the exact same event at any given time. That is especially useful when attaching actions to stage events.

    So before you go and start saying that it's stupid that they made things more complex, think about why they have been changed. How it's more efficient, and how it will help you accomplish different tasks.

    In my opinion, yes, it's worth the MINIMAL effort to learn AS3. I made a full comfortable transition in less than a week.

  4. #4
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    I learned AS3 in June. The biggest problem I had was that CS3 had just come out and it was hard to find any information on making the jump.

    I read a chapter or two from Keith Peters' Foundation AS3 Animation at Borders one day. (It's in the Flash section and has a bright pink spine). You can also get it from friendsofed.com for $20. I struggled for a week to understand OOP. After reading that chapter, I had grasped the concept pretty fully. Highly recommended.

  5. #5
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    yes
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    A main reason to learn it is because it is the only AS version, which is further supported by Adobe. I wrote a book and a big application in the book was first written in AS2, then in AS3. I was surprised that the same application in AS3 was much shorter scriptwise. However, when writing in AS3 because of so many different choices it is much more important to clean up the scripts after finishing (choosing Sprite over MovieClip is one example) to speed the compilation time.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  7. #7
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    AS2 is a scripting language which can be used as a programming language with a lot of effort.

    AS3 is a programming language which can be used for animation scripting with a little effort.

  8. #8
    Member
    Join Date
    Oct 2007
    Posts
    67
    not at all. as3 sucks balls. stick to as2. itll save you a hell of a lot of trouble.

  9. #9
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    what's with all the as3 hating this week?

    yes, as3 is frustrating at first if you don't have a good guide (which is why i recommended the peters book). but, after you get a handle on the basics its not bad at all.

  10. #10
    Member
    Join Date
    Oct 2007
    Posts
    67
    explain to me why there is no _root command

  11. #11
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    _root was always a horrible absolute reference anyways. I am glad that it's gone. It was suggested to NOT be used for a while now.

  12. #12
    Member
    Join Date
    Oct 2007
    Posts
    67
    yeah right. except it makes life a lot easier.

  13. #13
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    Ok. For one, AS3 is primarily focused on being a strong Object Oriented language. _root makes absolutely no sense in an Object Oriented approach to things. Everything is an object and should be referenced accordingly. There is no need for a true way to reach the top level. It should be irrelevant. Basically, in OOP, hierarchy is very seldom used.

    I hate repeating this to people, but if you don't understand OOP concepts, then stick with a non-OOP language. Like AS2 or AS1. Apparently it is no use for you.

  14. #14
    Member
    Join Date
    Oct 2007
    Posts
    67
    i don't care whether its OOP or not. thats just an idea. its about usability.

  15. #15
    5+5=55 Schfifty Five's Avatar
    Join Date
    Jun 2006
    Posts
    698
    Quote Originally Posted by mycaptainkite
    i don't care whether its OOP or not. thats just an idea. its about usability.
    Usability = OOP = no more _root
    Like he said, using _root in strict OOP makes no sense.

  16. #16
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    I honestly don't remember the last time I have ever used _root. It's not a matter of usability. It's a matter of sticking with old methods of doing things and trying to apply the same concept with new things.

    The people at Adobe aren't stupid. If the language never advances, it will never be able to compete on a corporate level or perform at the same speeds as something like Java. AS3 is a REALLY big step towards that. Try finding something even similar to _root in any other language. Then keep looking. And look some more.

  17. #17
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can still use root, but root itself is read only. You first need to write a Document class, which extends Sprite or MovieClip. The root property of the Document class instance is the top-most display object in the movie, which is comparable to but not the same as _root in AS2. By declaring the root of the Document class as a public static variable

    public static var _root:Sprite;
    public function MyDocumentClass()
    {
    _root = this;
    }

    you can get the root for the Document class from other classes and use it similar as you are used to as a reference point in your movie.

    Generally you should get used to use parent instead of _root in AS2. _root is not a good habit as others have stated. Here is a nice article by Nuno Mira about _root:

    http://www.nunomira.com/blog/?p=337
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  18. #18
    Member
    Join Date
    Oct 2007
    Posts
    67
    yeah. i guess you guys are right.

  19. #19
    Junior Member
    Join Date
    May 2006
    Posts
    5
    I love the transition to AS3 but I also have experience with c++, c, java, etc. I can totally see how someone with limited programming experience would have serious growing pains making the transition (especially if that experience is not OOP related and or was not in a strict setting).

    The best book I read for learning ActionScript OOP was Colin Moock's, Essential ActionScript 2.0. He now has Essential Actionscript 3.0 out now which I've read both raving reviews and not so good reviews. Either way, I recommend a book and patience for the transition.

  20. #20
    Member
    Join Date
    Oct 2007
    Posts
    67
    does someone have an article/tutorial explaining the concepts of OOP in a better way. i know the basics..ive done a little c++, php, and i do flash but pretty limited AS... i think i just need some better explanations

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