I am using flash CS3, Actionscript 3. I am trying to display a combobox in the cells of a datagrid column via cellRenderer.
I’ve created a class file with my cellrenderer code. Here’s just a couple of my attempts:
This adds a movie clip (from the library) to the cellrenderer. The movie clip contains a combobox. Everything works, but I can’t click on the combobox to display the options.
package
{
import fl.controls.listClasses.CellRenderer;
import flash.utils.getDefinitionByName;
import fl.controls.ComboBox;
import flash.events.Event;
public class myCellRenderer extends CellRenderer
{
public function myCellRenderer()
{
super();
// -------------- Create Combobox with School Names -----------------
var instance = new (getDefinitionByName("MyMovieWithComboBox")); // Create Instance of this movieclip which contains a combobox
this.addChild(instance); // Add this instance to the CellRenderer
}
}
}
In this attempt, I just dynamically create a combobox and add it to the cellRender. Nothing seems to work here. The combobox never appears.
package
{
import fl.controls.listClasses.CellRenderer;
import flash.utils.getDefinitionByName;
import fl.controls.ComboBox;
import flash.events.Event;
public class myCellRenderer extends CellRenderer
{
public function myCellRenderer()
{
super();
// -------------- Create Combobox with School Names -----------------
var myComboBox = new ComboBox();
this.addChild(myComboBox );
}
}
}
Thanks for any help.