Mega Code Archive

 
Categories / Flex / Development
 

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>