Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > UIObject class > UIObject.setSize() | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
componentInstance.setSize(width,height,noEvent)
width A number that indicates the width of the object, in pixels.
height A number that indicates the height of the object, in pixels.
noEvent A Boolean value that indicates whether the resize event should be dispatched.
Nothing.
Method; resizes the object to the requested size. You should pass only integer values to UIObject.setSize(), or the component may appear fuzzy. This method (as with all methods and properties of UIObject) is available from any component instance.
When you call this method on a ComboBox instance, the combo box is resized and the rowHeight property of the contained list also changes.
|
NOTE |
|
Some components allow you to modify height or width dimensions only. For example, the CheckBox and RadioButton components do not allow you to modify the height. |
The following example resizes the pBar component instance to 100 pixels wide and 100 pixels high:
pBar.setSize(100, 100);
The following example calls the setSize() method to resize the my_button Button component to 200 pixels wide by 100 pixels high:
var my_button:mx.controls.Button;
my_button.addEventListener("resize", doSize);
function doSize(evt_obj:Object):Void {
trace(evt_obj.target + " resized from {oldWidth:" + evt_obj.oldWidth + ", oldHeight:" + evt_obj.oldHeight + "} to {width:" + evt_obj.target.width + ", height:" + evt_obj.target.height + "}");
}
my_button.setSize(200, 100);
Flash CS3