2 Replies Latest reply on Jun 26, 2008 11:16 PM by TomTiDomTi

    Method CreateChildren in ApplicationControllBar class called twice after setting dock=true

    TomTiDomTi
      Hi during creating of a custom ApplicationControllBar component in ActionScript I probably found a (nasty) bug?!
      package net.neijman.julia.jaContainers
      {
      import mx.containers.ApplicationControlBar;
      public class JAApplicationControlBar2 extends ApplicationControlBar
      {
      public function JAApplicationControlBar2(): void
      {
      this.dock = true;
      super();
      }

      override protected function createChildren(): void
      {
      trace("CREATECHILDREN EXECUTED");
      }
      }
      }

      When I am using my simple custom component in my application: <jaContainer:JAApplicationControlBar2 />
      The trace message trace("CREATECHILDREN EXECUTED"); is executed twice (meaning CreateChildren is called twice BUT ONLY AFTER SETTING dock = true (see constructor). When setting dock = false CreateChildren is executed once. I want to build a framework on the standard components (depending heavily on the CreateChildren-method).

      In other words, creating dynamic components in the docked ApplicationControlBar in the method CreateChildren results in a double placement in the DisplayList.

      Has anyone has a clue what's going wrong here? (my workarround for now is to start the createChildren method with removeAllChildren();)

      Thanks Tom Neijman