SHARE
TWEET

Untitled

a guest Oct 21st, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         public function applyStatesToHost():void{
  2.             if (!hostComponent)
  3.                 return;
  4.            
  5.             if (!hostComponent.states)
  6.                 hostComponent.states = [];
  7.             var defaultState:DynamicState;
  8.             for each(var currentState:DynamicState in states){
  9.                 if (currentState.isDefault)
  10.                     defaultState = currentState;
  11.                 if (stateExistsInHost(currentState.name) == false){
  12.                     hostComponent.states.push(currentState.state);
  13.                     try{
  14.                         hostComponent.addChild(createUIService(currentState.name));
  15.                     }catch(e:Error){
  16.                         IVisualElementContainer(hostComponent).addElement(createUIService(currentState.name));
  17.                     }
  18.                 }
  19.             }
  20.             if (defaultState)
  21.                 hostComponent.currentState = defaultState.name;
  22.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top