User Guide

122 CellRenderer API
Example
This example returns the value multiplied by 3, which indicates that the cell should be three
times bigger than the length of the string it is rendering:
function getPreferredWidth():Number
{
return myString.length*3;
}
This example comments out the getPreferredWidth() method:
// function getPreferredWidth :: only for a menu or datagrid
CellRenderer.listOwner
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
componentInstance.listOwner
Description
Property; a reference to the list that owns the cell. That list can be a DataGrid, Tree, List, or
Menu component.
This method is provided by the List class; you do not have to implement it. Declare it in your
cell renderer class as follows, and use it as a reference back to the list (or tree, menu, or grid):
var listOwner:MovieClip; // or UIObject, etc.
Example
This example finds the list’s selected item in a cell:
var s = listOwner.selectedItem;