Migrating from AS2 to AS3

北慕城南 提交于 2019-12-13 08:34:44

问题


I would like to know from someone who have already done that, any recommendations and things I have to take a special look, I have seen some articles related to the topic, googled it, etc...

but I would like the advice from stackoverflower x)

I already know object oriented programming in c++, using classes and etc, but I can't quite understand AS3 packages and stuff, but i'm very familiarized with AS2.

Thanks


回答1:


  1. Drop everything you know, start fresh. AS2 is different than AS3. Don't try to do the AS2 thing with AS3.
  2. Read & Learn the Adobe LiveDocs
  3. Learn how the display list works.
  4. Learn AS3 coding standards, write clean readable code
  5. Learn how to use common actionscript libraries, TweenLite, Gaia framework, RobotLegs, Temple Library, Pure MVC, Away3D, as3corelib etc.
  6. Never ever code inside the Flash IDE actionspanel, there are really nice actionscript editors like FlashDevelop, FDT, FlashBuilder, IntelliJ.



回答2:


My experience migrating from AS2 to AS3 has been pretty smooth, so smooth that I would never go back and squirm at the thought of maintaining old AS2 code.

Firstly I would get familiar with the display list, here is a good article.

Then I would gain an understanding of the new types in AS3, especially the difference between Number, int and uint as you don't need to lump everything in Number anymore.

Do some reading up on the event system and how you can capture events that have bubbled up from other objects, and how you can use capture and stop them propagating further, and how to avoid unnecessary clicks on nested objects in buttons you create.

Like you say you already know OOP, so I would then suggest limiting timeline code as much as possible, write everything in classes.

XML is handled using e4x which makes xml parsing trivial, you will find this a breeze to work with compared to AS2.

The drawing api is now contained in a graphics library accessible through many display objects.

Get to know a good framework, I highly recommend pure MVC AS3

Finally for animation - there can be only one library - Greensock TweenMax AS3 of course ; )

EDIT :

I have looked around for some resources that I think will be of interest to you, I based these choices on my experiences and what I believe are key areas of research:

Presentation on AS3 by Grant Skinner - Excellent overview that you can refer to time and time again.

Getting Started with ActionScript 3.0 - Comprehensive approach to using AS3 with Flash CS3.

Senoculars tips of the day - because you already code in AS2 you should understand a lot of these tips and how they differ in AS3.



来源:https://stackoverflow.com/questions/10737096/migrating-from-as2-to-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!