PDA

View Full Version : Control will not render


mruncola
05-23-2008, 12:54 PM
I am seeing the grey box but I am not seeing my button control when it is created through this method?

I know the button object is created because the output window is showing:
ProductResultView Constructor: ProductResultView78
ProductResultView78.Button79



package prototype.display
{
import flash.display.LineScaleMode;
import mx.controls.Button;
import mx.core.UIComponent;

public class ProductResultView extends UIComponent

{
public function ProductResultView()
{
trace("ProductResultView Constructor: "+this);

graphics.lineStyle(1,0x999999,1,false,LineScaleMod e.NONE);
graphics.drawRect(50,50,50,50);
graphics.endFill();

var btn:Button = new Button();
btn.label = "Why?";
addChild(btn);

trace(btn);
}

}
}

mruncola
05-23-2008, 01:41 PM
Apparently the button control was actually rendering it just did not have a width and height specified and there is no default size.