1 Reply Latest reply on May 29, 2007 8:00 AM by peterent

    image in panel title

    skyfenix
      hi!
      how can I put an image in the panel title?
      I tried with tha same way that the button, like this:

      <mx:Panel id="myPan" title="Panel" icon="@Embed('image.png')">

      but it didn't work

      any idea?

      thank you
        • 1. Re: image in panel title
          peterent Level 2
          Create a component file which extends Panel - either MXML or ActionScript. You need to do this because you need access to the protected member, titleBar.

          Override the createChildren method and add an Image to the titleBar:

          [Embed("image.png")]
          private var yourEmbededImageClass:Class;

          override protected function createChildren() : void
          {
          super.createChildren();
          var img:Image = new Image();
          img.source = yourEmbededImageClass;
          titleBar.addChild(img);
          }

          You will also need to increase the Panel's title height (style: headerHeight) enough to accommodate the icon.