Guest User

Untitled

a guest
Jun 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import mx.utils.Delegate;
  2.  
  3. import com.control4.app_sdk_1_0.ui.UIText;
  4. import com.control4.app_sdk_1_0.ui.UITextStyle;
  5. import com.control4.app_sdk_1_0.ui.UIButton;
  6. import com.control4.app_sdk_1_0.ui.UIButtonStyle;
  7. import com.control4.app_sdk_1_0.ui.UIFrame;
  8. import com.control4.app_sdk_1_0.nav.UIView;
  9. import com.control4.app_sdk_1_0.nav.UINavigation;
  10. import com.control4.app_sdk_1_0.util.UILoader;
  11.  
  12.  
  13. class MyFirstPage extends UIView {
  14.    
  15.     private var button:UIButton;
  16.     private var helloText:UIText;
  17.  
  18.     public function MyFirstPage()
  19.     {
  20.         this.onLoad = this.init;
  21.     }
  22.    
  23.     public function init()
  24.     {
  25.         super.init("MyFirstPage", this);
  26.         var queue:Array = new Array();
  27.         var buttonFrame:UIFrame = new UIFrame(1,100,200,50);
  28.         var textFrame:UIFrame = new UIFrame(1,200,200,50);
  29.         queue.push({ target: this, component: "UIButton", instanceName:"button", frame: buttonFrame })
  30.         queue.push({ target: this, component: "IOText", instanceName:"helloText", frame: textFrame })
  31.         var loader:UILoader = new UILoader();
  32.         loader.load(queue, Delegate.create(this, componentsBuilt));
  33.     }
  34.    
  35.     public function componentsBuilt():Void {
  36.         this._parent.nav.makeVisible();
  37.     }
  38. }
Add Comment
Please, Sign In to add comment