0

I am implementing my own CustomCellRenderer for a TileList. It has it's own button that I add, but the button won't display anything except the label text. Here is a code snippet:

public class CustomCellRenderer extends ImageCell implements ICellRenderer
{               
        private var m_listData:ListData;
        private var m_data:Object;
        private var m_buyButton:Button;

        public function CustomCellRenderer ()
        {
            m_buyButton = new Button();
            m_buyButton.width = 25;
            m_buyButton.height = 50;
            m_buyButton.x = 40;
            m_buyButton.y = 50;
            m_buyButton.textField.text = "BUY";
            m_buyButton.addEventListener(MouseEvent.CLICK, OnPurchaseClick);
            addChild(m_buyButton);
        }

    private function OnPurchaseClick(e:Event):void
    {
        trace("PurchaseClick");
    }

    public override function set data(a_data:Object):void
    {
        label = "";
        m_data = a_data;
    }

    public override function get data():Object
    {
        return m_data;
    }

    public override function set listData(a_listdata:ListData):void
    {
        m_listData = a_listdata;
    }

    public override function get listData():ListData
    {
        return m_listData;
    }
}

The "BUY" label shows up, so the button isn't offscreen and is actually a child of the cell, but for some reason the button skin isn't showing up and it won't take any mouse clicks. I have tried setting different upskins for the button and nothing changes. I am at a loss here, anyone have an idea as to what might be happening?

4

0 回答 0