enterState Flex Event
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.