Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function applyStatesToHost():void{
- if (!hostComponent)
- return;
- if (!hostComponent.states)
- hostComponent.states = [];
- var defaultState:DynamicState;
- for each(var currentState:DynamicState in states){
- if (currentState.isDefault)
- defaultState = currentState;
- if (stateExistsInHost(currentState.name) == false){
- hostComponent.states.push(currentState.state);
- /*try{
- hostComponent.addChild(createUIService(currentState.name));
- }catch(e:Error){
- IVisualElementContainer(hostComponent).addElement(createUIService(currentState.name));
- }*/
- }
- }
- if (defaultState)
- hostComponent.currentState = defaultState.name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement