Positioning a label within a progress bar using the ProgressBar.labelPlacement property

by Peter deHaan on August 8, 2007

in ProgressBar

We’ve looked at this briefly in a previous entry, but here’s a quick look at each of the five options for the ProgressBar.labelPlacement property.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/08/positioning-a-label-within-a-progress-bar-using-the-progressbarlabelplacement-property/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Label text="ProgressBar.labelPlacement" />
    <mx:HBox>
        <mx:VBox>
            <mx:RadioButtonGroup id="rbg" />
            <mx:RadioButton label="left" group="{rbg}" />
            <mx:RadioButton label="center" group="{rbg}" />
            <mx:RadioButton label="right" group="{rbg}" />
            <mx:RadioButton label="top" group="{rbg}" />
            <mx:RadioButton label="bottom" group="{rbg}" />
        </mx:VBox>
        <mx:VBox backgroundColor="white"
                horizontalAlign="center"
                verticalAlign="middle"
                width="200" height="100%">

            <mx:ProgressBar id="progressBar"
                    barColor="haloOrange"
                    label="{rbg.selectedValue}"
                    labelPlacement="{rbg.selectedValue}"
                    mode="manual"
                    width="150"
                    creationComplete="progressBar.setProgress(50, 100)" />

        </mx:VBox>
    </mx:HBox>

</mx:Application>

View source is enabled in the following example.

{ 2 comments… read them below or add one }

1 Niks September 20, 2007 at 12:21 am

Hi there , i have been usually going through your applications. its really amazing work.
I have some query regarding Progress Bar.

I have created a FLV player with Play, Start, End and Stop Buttons.

Where start is starting point and end is ending point. After Assigning these both points ,play the video u will just have that much duration video.
The Progress Bar Progressively increasing with the video.

Now when i press start button. i need to show a point on Progress Bar or need to change color of Progress Bar when Start Point assigned. so user can know this is start point .

same with the end point .

Please have look on this query

Thanks in Advance
Niks

Reply

2 vinod July 22, 2009 at 12:56 am

Hi,

Is there a way to place the progress bar control within a Data Grid column ? i need to show the progress of each row in the data grid.
Appreciate your help

Reply

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: