Use setStyle() method
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> private function initVBox():void { myVBox2.setStyle("paddingTop", 12); myVBox2.setStyle("paddingBottom", 12); } </mx:Script> <mx:VBox id="myVBox1" borderStyle="solid"> <mx:Button label="Submit" /> </mx:VBox> <mx:VBox id="myVBox2" borderStyle="solid" initialize="initVBox();"> <mx:Button label="Submit" /> </mx:VBox> </mx:Application>