I have an issue to let my component look same in runtime and design
time.
Component is container which looks like that:
public class MyContainer extends Canvas
{
componentsEnvelop:LayoutContainer = new LayoutContainer();
override public function initialize():void {
componentsEnvelop.percentHeight=100;
componentsEnvelop.percentWidth=100;
componentsEnvelop.setStyle("backgroundColor","#ffffff");
super.initialize();
}
override public function
addChild(child:DisplayObject):DisplayObject {
return componentsEnvelop.addChild(child);
}
private function
addChildSpecial(child:DisplayObject):DisplayObject {
return super.addChild(child);
}
override public function
removeChild(child:DisplayObject):DisplayObject {
return componentsEnvelop.removeChild(child);
}
private function doLayout():void {
this.addChildSpecial(componentsEnvelop);
this.addChildSpecial(titleBar);
titleBar.addChild(_label);
}
override protected function createChildren():void
{
super.createChildren();
doLayout();
}
}
in run time everything looks ok, but in design time in Flex Builder all
component I put inside my MyContainer displayed always beyond the
LayoutContainer and therefore invisible. How to handle that cituation,
what method should be override to intercept child add in design time?