2 Replies Latest reply on May 4, 2009 7:46 PM by PeakDigital

    Problems with docked ApplicationControlBar?

    PeakDigital Level 1

      Just curious if anyone else has had problems utilizing a docked ApplicationControlBar.

       

      My app's base state contains just a simple, standard Panel for login.

       

      Once a user logs in I want there to be an ApplicationControlBar, docked at the top. However, I was getting error 2025 "The supplied DisplayObject must be a child of the caller." when switching from the base state to the logged-in state where the ACB is needed.

       

      There is no error if the ACB is not set to dock=true, but for the design of my app, a control bar set at the top, that won't scroll, is essential.

       

      I found a workaround by leaving the AddChild for the ACB in the state definition as dock=false, then calling a script from the effectEnd event of the last effect in the state transition sequence that adds the controls to the ACB and sets dock=true.

       

      Now I am working on the logout coding and am running into problems, again with the docked ACB.

       

      I started by having the logout button.click script be simply currentState="" and that resulted in the same 2025 error as before.  (the logout button is in a GridItem in a custom component extending Grid that is a child of the ACB)

       

      Then I tried adding this code to my logout script

      appcontrolbar1.dock=false;
      appcontrolbar1.removeAllChildren();
      appcontrolbar1.visible=false;

      currentState="";

       

      Even after setting dock=false and removing the ACB's children, setting currentState="" still results in error 2025. The previous 3 lines execute without problem.

       

      I found a couple references to similar issues:

      http://bugs.adobe.com/jira/browse/SDK-12080

      http://www.flexforum.org/viewtopic.php?f=4&t=29&view=previous

       

       

      Has anyone else dealt with this problem and have some suggestions for alternative solutions?

       

      Thanks.

      Paul