08
Aug
07

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

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.


1 Response to “Positioning a label within a progress bar using the ProgressBar.labelPlacement property”


  1. 1 Niks Sep 20th, 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

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".