开发者

Method to learn Flash AS3 for a Java developer? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_Python百科

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

I am a Java developer. I am good at learning new languages but I can't make head or tail of AS3. It seems like a different mindset that I can't get into or something.

Could you provide links a AS3 tutorials that explain everything well, preferable targeted for people who have already programmed?

Thanks so much.


Here are some online links:

A few chapters form Colin Moock's DVD series
Getting started with ActionScript3
Language reference

If you are really serious about getting into it, I highly recommend picking up Colin Moock's book Essential ActionScript 3.0 I think its the best book you can buy.

Enjoy!


There is nothing different in AS3 except minor syntax differences, and that fact that it's a bit more dynamic language.

  • it is object oriented
  • it supports classes and interfaces
  • it has instance vs static methods/fields
  • it has all the visibility modifiers
  • etc..

A few differences:

  • it supports functional programming (you can pass functions as parameters)
  • you can refer to object fields even if you are not sure they exist at compile time. (somebody correct me if I'm wrong here - it was 2 years ago I last wrote AS3)

I was in the same situation - Java background, and the need to learn AS3 very quickly. Didn't have any problems, apart from a few small things, like

  • the need to cast to Object if you are referring to an object by interface.
  • the fact that default components do not use a full-featured observer pattern, and sometimes you need it.
  • exception handling is a bit weird at first.

To conclude - learning on-the-fly worked fine for me.


If you know the basics of any programming language - Datatypes, Functions, Conditional statements, loops, operators and so on, it is not difficult to program in AS3.

In my experience, more than tutorials the best help has been practice. As programmers, we often feel the need to first try it out ourselves to learn better. Believe me, once you start practicing, it wouldn't be so difficult and you will start noticing the similarities AS3 has with Java.


I'm actually in the opposite situation, learning Java while being a long-time AS3 developer.

It's interesting that you're finding a lot of differences, as I'm actually finding similarities. The things that are probably most different are that

  • AS3 has functions that are first class objects, and thus can be passed around
  • Time measurement in AS3 is heavily dependent on the concept of the ENTER_FRAME event (though you do have the ability to create Timer objects, screen updates happen as close as possible to the ENTER_FRAME interval).
  • You do NOT want to "sleep" execution in AS3 (no matter how much you think you might) as Flash wants very badly to be able to keep rendering the screen, and anything that would prevent code from executing (such as perhaps churning through a ten-million iteration for-loop) will stop the renderer from updating. If this continues past 15 seconds, "bad things" will happen.
  • Flash is single-threaded, though you can simulate threads with Timer objects (maybe or maybe not a good idea. You gain no performance benefits at all from this, unless you use the timer to chop up execution of a ridiculously long process).

As for similarities

  • The type system is optional, but encouraged (and very much like Java's, except with different syntax).
  • They both have single inheritance / multiple interface style OOP.
  • They both have the same style of package structure for their classes
  • They both have a notion of Exceptions, though in Flash you can think of all exceptions as being RuntimeExceptions and there is no such thing as a checked exception.

As far as tutorial sites, that depends on what you really want to do with Flash. Are you looking more at doing games? RIAs?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜