Inability to easily initialize views due to creationComplete and addToStage event order uncertainty

Description

When constructing a view (depending on its container and use) the order that [PostConstruct], creationComplete, and addToStage events fire can differ (they don't always follow the ordering here (http://swizframework.jira.com/wiki/display/SWIZ/Bean+Life+Cycle+Management#BeanLifeCycleManagement-SwizandFlexLifeCycleSteps). This makes it very difficult to do initialization, especially if you need to initialize an MXML view component with an object that is injected by Swiz (i.e. you need to know that both events are complete). Relying on Swiz to inject its events after either creationComplete or addToStage is not enough since, depending on use, those can come in different order.

The fix seems to incorporate 2 parts:
1) Allow the [PostConstruct] event to fire after BOTH creationComplete AND addToStage have completed.
2) Fix event ordering so that [PostConstruct] occurs after the addToStage or creationComplete (whichever is setup in the documentation)

I have included different test projects that illustrate the issue of event order.

Environment

Win7, SDK 3.5, Flash Builder 4 IDE

Status

Assignee

Ben Clinkinbeard

Reporter

Scott Roberts

Labels

None

Fix versions

Affects versions

Priority

Major
Configure