I'm trying to improve my code by writing unit tests for my ActionScript 3 code for Flash projects I work on, but I'm having a mental hurdle understanding how to deal with it in the context of a Flash program. I can't seem to wrap my head around how to deal with things like addChild and the stage, as well as all the asynchronous processing typical of Flash applications (addEventListeners for waiting for things to load, etc.). Is it really any different than any other language? How does a developer deal with the unique environment of a Flash program?
A few clarifications:
- This has nothing to do with Flex, no Flex is involved at all.
- Programs only involve AS3 code files and an FLA containing assets.