Relax Breath of Solution.Community tech blog of Sameera Thilakasiri - Consultant UI, UX, RWD Specialist/ Interactive Designer

Just I wanted.. Do you?…

Setting a Flex ProgressBar control’s text indent – mx:ProgressBar

Posted on February 14, 2010 | No Comments

The following example shows how you can control the amount of text indenting on a progress bar label.

<?xml   version="1.0" encoding="utf-8"?>
<mx:Application   xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">

<mx:Script>
<![CDATA[
	private     <a   href="http://cialis-online-price.net">buy cialis now</a>    function progressBar_creationComplete():void     
	{
		progressBar.setStyle(&quot;labelWidth&quot;,   progressBar.width);
		progressBar.setProgress(35,   100);
	}

	private   function comboBox_change():void   
	{
		progressBar.labelPlacement   = comboBox.selectedItem.toString();
	}

	private     function slider_change():void 
	{
		progressBar.setStyle(&quot;textIndent&quot;,     slider.value);
	}
]]&gt;
&lt;/mx:Script&gt;

&lt;mx:ApplicationControlBar       dock=&quot;true&quot;&gt;
	&lt;mx:Label       text=&quot;textIndent:&quot; /&gt;
	&lt;mx:HSlider id=&quot;slider&quot;
		minimum=&quot;0&quot;
		maximum=&quot;60&quot;
		liveDragging=&quot;true&quot;
		showTrackHighlight=&quot;true&quot;
		dataTipPrecision=&quot;0&quot;
		snapInterval=&quot;1&quot;
		tickInterval=&quot;10&quot;
		labels=&quot;[0,20,40,60]&quot;
		change=&quot;slider_change();&quot;             /&gt;
	&lt;mx:Spacer width=&quot;50&quot;   /&gt;
	&lt;mx:Label text=&quot;labelPlacement:&quot; /&gt;
	&lt;mx:ComboBox id=&quot;comboBox&quot;
		selectedIndex=&quot;4&quot;
		change=&quot;comboBox_change();&quot;&gt;
		&lt;mx:dataProvider&gt;
			&lt;mx:Array&gt;
				&lt;mx:String&gt;left&lt;/mx:String&gt;
				&lt;mx:String&gt;center&lt;/mx:String&gt;
				&lt;mx:String&gt;right&lt;/mx:String&gt;
				&lt;mx:String&gt;top&lt;/mx:String&gt;
				&lt;mx:String&gt;bottom&lt;/mx:String&gt;
			&lt;/mx:Array&gt;
		&lt;/mx:dataProvider&gt;
	&lt;/mx:ComboBox&gt;
&lt;/mx:ApplicationControlBar&gt;

&lt;mx:ProgressBar                       id=&quot;progressBar&quot;
	mode=&quot;manual&quot;
	label=&quot;%1 <a href="http://blogtorn.com/images/">where do you buy viagra | buy cialis phentermine | cheap levitra online</a>    of %2 (%3%%)&quot;
	creationComplete=&quot;progressBar_creationComplete();&quot;   /&gt;

&lt;/mx:Application&gt;

Author
Sameera Thilakasiri By Sameera Thilakasiri
,is a front-end developer based in Colombo, is a blogger and a lifestyle photographer.
Follow him Twitter and Google+. Check out him.

Comments

Leave a Reply

You must be logged in to post a comment.