User Guide
154 Chapter 6: Components Dictionary
Example
This example sizes an image in the cell to fit within the bounds specified by the list:
function setSize(w:Number, h:Number):Void
{
image._width = w-2;
image._height = h-2;
image._x = image._y = 1;
}
This example is in a cell renderer class that extends UIComponent (which extends UIObject), so
you must implement
size() instead of setSize(), as follows:
// By extending UIComponent, you get setSize for free;
// however, UIComponent expects you to implement size().
// Assume __width and __height are set for you now.
// You’re going to expand the cell to fit the whole rowHeight.
function size():Void
{
// __width and __height are the underlying variables
// of the getters/setters .width and .height.
var c = multiLineLabel;
c._width = __width;
c._height = __height;
}
CellRenderer.setValue()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
componentInstance.setValue(suggested, item, selected)
Parameters
suggested
A value to be used for the cell renderer’s text, if any is needed.
item An object that is the entire item to be rendered. The cell renderer can use properties of
this object for rendering.
selected A string with the following possible values: "normal", "highlighted", and
"selected".
Returns
Nothing.