MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 116

Components language reference
Table of Contents

Advertisement

c.setSize(__width, __height);
}
// Provides the preferred height of the cell. Inherited method.
public function getPreferredHeight():Number
{
/* The cell is given a property, "owner", that references the row. It's
always preferred that the cell take up most of the row's height. In
this case we will keep the cell slightly smaller.*/
return owner.__height - PREFERRED_HEIGHT_OFFSET;
}
// Called by the owner to set the value in the cell. Inherited method.
public function setValue(suggestedValue:String, item:Object,
selected:Boolean):Void
{
/* If item is undefined, nothing should be rendered in the cell, so set
the label as invisible. Note: For scrolling List type components like
a scrolling datagrid, the cells are intended to be empty as they
scroll just out of sight, and then the cell is reused again and set to
a new value producing an animated effect of scrolling. For this
reason, you cannot rely on any one cell always having data to show or
the same value.*/
if (item!=undefined){
multiLineLabel.text._visible = false;
}
multiLineLabel.text = suggestedValue;
}
// function getPreferredWidth :: only for menus and DataGrid headers
// function getCellIndex :: not used in this cell renderer
// function getDataLabel :: not used in this cell renderer
}
Creating an application to test the MultiLineCell cell
renderer class
In the following steps, you will create the DataGrid instance and implement the
MultiLineCell class.
To create an application with a DataGrid component that uses the
MultiLineCell cell renderer class:
1.
In Flash, select File > New > Flash Document.
2.
Select File > Save As, name the file cellRender_tutorial.fla, and save the file to the same
folder as the MultiLineCell.as file.
3.
To create a new movieClip symbol to link to the MultiLineCell class, select Insert > New
Symbol.
114
CellRenderer API

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents