Add controls with ActionScript : ActionScript « Development « Flex






Add controls with ActionScript

Add controls with ActionScript
          

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="addItems()">
    <mx:Script>
        
            import mx.controls.Button;
            import mx.controls.TextInput;
            private function addItems(  ):void
            {
                var ti:TextInput = new TextInput(  );
                this.addChild(ti);
                var btn:Button = new Button(  );
                btn.label = "Submit";
                this.addChild(btn);
            }
      
    </mx:Script>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use ActionScript to configure controlsUse ActionScript to configure controls
2.Applying behaviors in ActionScript with Resize classApplying behaviors in ActionScript with Resize class
3.Set target and targets properties in ActionScriptSet target and targets properties in ActionScript
4.Load swf file with ModuleManager in ActionScriptLoad swf file with ModuleManager in ActionScript
5.Inline ActionScriptInline ActionScript
6.Setting Triggers With ActionScriptSetting Triggers With ActionScript
7.Set Properties of a Child Defined in MXML in ActionScriptSet Properties of a Child Defined in MXML in ActionScript
8.Bind to Properties by Using ActionScriptBind to Properties by Using ActionScript
9.Specify an id value to refer to a component elsewhere in your MXML, either in another tag or in an ActionScript blockSpecify an id value to refer to a component elsewhere in your MXML, either in another tag or in an ActionScript block
10.Tags Are ClassesTags Are Classes
11.Attributes Are PropertiesAttributes Are Properties