Creating a multiline title bar for the Panel component

Posted on 2008-06-11
Last Modified: 2008-06-12

Can anyone point me in the right direction for creating a multi-line title bar for the Panel component in Flex 3?  I know I'll have to subclass it, etc.  But I could use some pointers as to where to start.  Any help would be appreciated.
Question by:asaivan
LVL 19

Accepted Solution

Gary Benade earned 500 total points
ID: 21768441
<mx:Application xmlns:mx="" layout="absolute" xmlns:local="*">
      <local:MultiLineHdrPanel title="This is a long title that should wrap to 2 lines" width="682" height="368"/>

save code below as


	import mx.containers.Panel;

	import mx.controls.Text;

	public class MultiLineHdrPanel extends Panel


		private var multiLineHdr:Text;

		public function MultiLineHdrPanel()




		override protected function createChildren():void



            multiLineHdr = new Text();

            multiLineHdr.width = 150;

            multiLineHdr.height = 30;            

            this.titleBar.addChild( multiLineHdr);

   			this.setStyle("headerHeight", 38);            


        override protected function layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void


        	super.layoutChrome(unscaledWidth, unscaledHeight);

        	this.titleTextField.visible = false;            

        	multiLineHdr.text = this.title;

            multiLineHdr.move( 4, 4);





Open in new window


Author Comment

ID: 21772195
yep, that's it. sweet.

Expert Comment

ID: 22257535

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now