Bean Life Cycle Management
Comments
How can I determine, that the Swiz initialized? For example, in my test case during setUp?
If you have a specific question, the mailing list would probably provide a better answer. But in general, I use the UIImpersonator in FlexUnit 4, since it handles making sure that the container being tested has been set up.
Flex will sometimes dispatch a REMOVED_FROM_STAGE event immediately followed by an ADDED_TO_STAGE event when the window is resized. Does Swiz optimize this, or does this always result in a view teardown + setup cycle?
See http://blogs.adobe.com/pmartin/2010/03/use_of_stage_ev.html
Nevermind, answered my own question: yes, Swiz does optimize away these superfluous events. In case anyone's interested this is handled by BeanFactory methods tearDownEventHandler and addRemovedDisplayObject.
RE> At the other end of the bean life cycle, the default
tearDownEventTypeis "removedFromStage". This means that when a UI component is removed from the stage, Swiz will perform clean up activities such as removing event mediators.This bit is very important to understanding. Developers may need to use [PreDestroy] which will be called after removedFromStage.