I am having problems creating a custom component that not only contains children but whose children also contain children of their own. I first tried creating the component using mxml which didn't work, then I tried using ActionScript to create a class that extended HGroup which didn't work either. So now I'm trying to create it by extending UIComponent and overwriting the necessary methods like createChildren. I'm not getting a syntax error, but when I try to run the application the progress bar just hangs. When I comment out the code in red below it works fine.
public class Footer3 extends UIComponent
public function Footer3()
this.bottom = 0;
this.left = 0;
this.percentWidth = 100;
private var footerBar:HGroup;
private var footerLinks:BorderContainer;
override protected function createChildren():void
if(footerBar == null)
footerBar = new HGroup();
footerBar.percentWidth = 100;
footerBar.gap = 0;
if(footerLinks == null)
footerLinks = new BorderContainer();
footerLinks.borderStroke = null;
footerLinks.height = 38;
footerLinks.percentWidth = 100;
footerLinks.styleName = "footerLinks";
override protected function measure():void
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
I'm guessing that doing addChild inside createChildren causes an infinite loop.
Why aren't you just doing this with MXML? it would be a lot simpler.