开发者

When you program in as3, do you usually use classes?

I want other programme开发者_如何学编程rs' opinions on this. When you program in as3, do you usually use classes? Why?


ActionScript is an object-oriented programming language, so it is recommended that classes are used to provide modularity to your code freeing up actions and functions in the main timeline. So it should not really be a question whether or not to use classes.

Try reading up on The Lost ActionScript Weekend to give you a crash course on what modularity means in AS3, especially the first section on "Building an airplane"

airplane in flight
- group of interoperating parts based on a set of blueprints
program running
- group of interoperating objects, based on a set of classes

When you program in as3, do you usually use classes?


i do.
because it's a great way to create reusable and well organized code


Always, because it makes big projects humanly manageable. Also, classes are reusable in any other projects. Object-oriented Programming was not invented for nothing; big projects would be impossible to manage.


Yes, even if it just a Main class that represents the main timeline. To be honest, though, every time opt for a minimal one class project and don't use my PureMVC baseline, the project grows and I kick myself. Going full PureMVC on an initially simple project really saved me recently because it took a few left turns and ended up with some rather complex logic. Instead of rewriting everything, most of the new logic involved new notifications (ie, PureMVC events), and reworking who responded to what notifications and when.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜