FlexEvent
The updateComplete event is dispatched from all UIComponents after they have been through the validation phase in the rendering lifecycle. It is called after the commitProperties(), measure(), and updateDisplayList() methods have been called.
This method will only be called when the component is invalidated. Some components will not be invalidated very often during their lifecycle if their size is constant and they do not perform rendering updates or have their properties changing. Other components, however, will dispatch this event quite often as they respond to user input or other events to update themselves.
The enterState event is dispatched from the State class when a new state has been entered. The class that actually dispatches this event is UIComponent. State is actually a very small class that exposes an mx_internal method dispatchEnterState() which UIComponent hijacks since it is in charge of applying states to itself:
-
private function applyState(stateName:String, lastState:String):void
-
{
-
var state:State = getState(stateName);
-
-
if (stateName == lastState)
-
return;
-
-
if (state)
-
{
-
// Apply "basedOn" overrides first
-
if (state.basedOn != lastState)
-
applyState(state.basedOn, lastState);
-
-
// Apply new state overrides
-
var overrides:Array = state.overrides;
-
-
for (var i:int = 0; i < overrides.length; i++)
-
overrides[i].apply(this);
-
-
// Dispatch the "enterState" event
-
state.dispatchEnterState();
-
}
-
}
This code is called from commitCurrentState() which is also a private method in UIComponent.
