MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 151

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Usage
componentInstance.getPreferredHeight()
Parameters
None.
Returns
The correct height for the cell.
Description
Method; returns the preferred height of a cell. This is especially important for getting the right
height of text within the cell. If you set this value higher than the
component, cells will bleed above and below the rows.
This method is not provided by the List class; you must implement it. It tells the rows of the list
how to center the cell and how to adjust the cell's height if necessary. If necessary, you can return
a constant (for example, 22), or you can measure and return the height of the contents. You can
also return
owner.height
Example
This example returns the value 20, which indicates that the cell should be 20 pixels high:
function getPreferredHeight(Void) :Number
{
return 20;
}
This example returns a value that is 4 pixels less that the height of the row:
function getPreferredHeight():Number
{
/* You know the cell is given a property, "owner", which is the row. It's
always preferred for the cell to take up most of the row's height.
*/
return owner.__height - 4;
}
CellRenderer.getPreferredWidth()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
componentInstance.getPreferredWidth()
Parameters
None.
, which is the height of the row.
property of the
rowHeight
CellRenderer API
151

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents