The following example shows how you can change the move interval of an indeterminate progress bar in Flex by setting the indeterminateMoveInterval style.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/10/08/changing-the-indeterminate-move-interval-of-a-flex-progressbar-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:ApplicationControlBar dock="true">
        <mx:Label text="indeterminateMoveInterval:" />
        <mx:HSlider id="slider"
                minimum="20"
                maximum="200"
                value="50"
                liveDragging="true"
                snapInterval="1"
                tickInterval="10"
                dataTipPrecision="0" />
    </mx:ApplicationControlBar>

    <mx:ProgressBar id="progressBar"
            label="indeterminateMoveInterval = {slider.value}"
            labelPlacement="center"
            indeterminate="true"
            indeterminateMoveInterval="{slider.value}"
            trackHeight="64" />

</mx:Application>

View source is enabled in the following example.

 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

6 Responses to Changing the indeterminate move interval of a Flex ProgressBar control

  1. Kyle Hayes says:

    Is this only for Flex 3?

  2. peterd says:

    Kyle Hayes,

    Yeah, I’m pretty sure this was added in Flex 3.

    Peter

  3. Hey Peter,

    If you’ve ever played on Xbox Live and sent a voice message you’ll
    notice that it’s a 10 second countdown indicated by a progress bar… I
    want to accomplish the same thing.

    I am recording Video to the FMS (VideoDisplay) and need to show the progress of the
    record time (say max record time is 30 seconds) and when the progress
    bar reaches it’s max (30 second duration), the video stops recording (just
    like XBox live).

    Secondly, when being played back, I need it to show the same progress…
    from the beginning of the video to the end duration.

    Would you happen to know how to use the ProgressBar in this way?

  4. Javier Julio says:

    Peter, is their a property that speeds up the animation? I’m using the indeterminate animation for any process and sometimes they don’t take to long but the animation plays to slow to notice it.

  5. peterd says:

    Javier Julio,

    I don’t see a property/style that easily allows that. The easiest way may be to set the indeterminateMoveInterval to something small like 20, or create a custom indeterminate skin for the Flex ProgressBar control which gives you the effect you want.

    Peter

  6. Rahul says:

    how to add Progress Bar with video control in Flex3.

Leave a Reply

Your email address will not be published.

You may 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