Set Properties of a Child Defined in MXML in ActionScript : ActionScript « Development « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Development » ActionScriptScreenshots 
Set Properties of a Child Defined in MXML in ActionScript
Set Properties of a Child Defined in MXML in ActionScript
          
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:HBox width="400" height="300">
        <mx:Script>
            
    
                private function changeAppearance():void
                {
                    this.width = Number(widthInputField.text);
                    this.height = Number(heightInputField.text);
                }
    
          
        </mx:Script>
        <mx:Image id="imageDisplay"/>
        <mx:Text text="Enter a width"/>
        <mx:TextInput id="widthInputField"/>
        <mx:Text text="Enter an height"/>
        <mx:TextInput id="heightInputField"/>
        <mx:Button click="changeAppearance()" label="Change Size"/>
    </mx:HBox>
</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.Add controls with ActionScriptAdd controls with ActionScript
5.Load swf file with ModuleManager in ActionScriptLoad swf file with ModuleManager in ActionScript
6.Inline ActionScriptInline ActionScript
7.Setting Triggers With ActionScriptSetting Triggers With 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
w_w_w___.__j__a__va___2s___.___co__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.