3 Replies Latest reply on Nov 1, 2007 4:30 PM by ntsiii

    Need some help with Panel

      NOTE: I am using Flex Builder 3, I'm not sure if just the BUILDER is upgraded to 3, or Flex is upgraded as well. There doesn't seem to be a Flex 3 forum here or on Adobe labs. I am posting here hoping that this is a general Flex problem and someone can help me.

      I and trying to make a sub-class of Panel with a series of buttons at the top. As the buttons will be outside the container area, I chose to put them into the titleBar. using titleBar.addChild()

      The problem is, the buttons I place inside the titleBar do not get Events.

      In what I think is a related problem. If you adjust the "headerHeight" property to say "12" and then have controls (button/combo) at the top of the panel's container, the top of controls do not get events, but the bottom of the controls do. It seems that something in the Panel is blocking events at the top of the panel.

      Any ideas?

        • 1. Re: Need some help with Panel
          ntsiii Level 3
          This is not a "solution", but if you get stuck with this an easy hack is to extend Canvas, add a Panel, then declare your buttons, and use x,y to position them "above" the titlebar.

          I don't think it is the "right" way, but it damn sure works.
          • 2. Re: Need some help with Panel
            ClubPetey Level 1
            I have gathered more information about this issue today. it seems that the issue is not the panel, but the outer container that I embedded it into. The effect I was trying to get was a panel with a highlight at the top. To do this the border alpha has to be set to "0" otherwise you see odd artifacts, but then the highlight can only apply to the background color.

            To get the effect I wanted, I embeded the panel with the highlight and buttons inside another panel (with the backgroundColor i wanted and solid border) embeding the panels is what caused the mouse events to go missing. Changing the outer Panel to a Canvas fixed the problem.

            However I still think there is a problem with Panels. embedding a Panel inside another Panel should not make the mouse events disappear. I'm just not sure where the real problem is.

            If anyone is curious, i can prepare a simple test app that shows the bug.


            • 3. Re: Need some help with Panel
              ntsiii Level 3
              Hmm, an alpha="0" will stop mouse events in some situations. This is in the docs somewhere.

              I do not know if it applies to your situation.