View comments | RSS feed

UIObject.setSize()

Availability

Flash Player 6 (6.0 79.0).

Edition

Flash MX 2004.

Usage

componentInstance.setSize(width, height)

Parameters

width A number that indicates the width of the object, in pixels.

height A number that indicates the height of the object, in pixels.

Returns

Nothing.

Description

Method; resizes the object to the requested size. You should pass only integral values to UIObject.setSize(), or the component may appear fuzzy. This method (like 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 is also changed.

Example

This example resizes the pBar component instance to 100 pixels wide and 100 pixels high:

pBar.setSize(100, 100); 

Comments


FlashGen said on Aug 19, 2004 at 7:44 AM :
Does this actually work as I have so far failed to get this to do anything with the Alert dialog - even though it suggests this should work

FG
MM tech writer said on Aug 19, 2004 at 10:45 AM :
Check out the Alert documentation:
http://www.macromedia.com/livedocs/flash/mx2004/main_7_2/00002076.html#wp3135818

The Alert component doesn't resond to setSize().
KASDKASD said on Oct 28, 2004 at 7:22 PM :
Hi,
Could you please provide a better example for the setSize method. The
single line of code you've got here is not enough to give me any idea of
how to use this method. thanks.

(ie, instantiate something, put it on stage, call the method?)

thanks,

brendan
jepo said on Nov 8, 2004 at 2:14 PM :
There is an example on this page:

http://livedocs.macromedia.com/flash/mx2004/main_7_2/00002963.html

Hope that helps,
Jen.
Maglez said on May 18, 2005 at 1:42 AM :
Hello there.

The documentation concerning this command, setSize(), says...

"When you call this method on a ComboBox instance, the combo box is resized and the rowHeight property of the contained list is also changed."

...however, when apply this command, the rowHeight of the contained list doesn't change, it's the standard 20 pixels..

Is it this a bug or it only happen to me? Could please someone test the below code and report success or fail?

Thanks.


//cb is an instance of a ComboBox component on Stage
cb.setSize(300, 50);
looklisten said on Jul 22, 2005 at 11:21 AM :
Is there a method I need to call after calling setSIze on a textarea component to update the scrollbar? If not, how can I reinitialize the scrollbar based on the new height?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00002951.html