The Busy Indicator component gives the user a visual indication that the application is in the middle of an operation, e.g. a long-running calculation or a network operation.
When starting a long-running operation, such as a network operation, add the BusyIndicator to the display list. After the operation has completed, remove the BusyIndicator from the display list. An alternative to adding and removing the BusyIndictor to/from the display list is to leave the BusyIndicator on a controlBar and change the BusyIndicator's visibility to show and hide it. The BusyIndicator will be implemented not to use any processor time when it is not visible.
BusyIndicator
package spark.components
{
//--------------------------------------
// Styles
//--------------------------------------
/**
* The interval to delay, in milliseconds, between rotations of this
* component. Controls the speed at which this component spins.
*
* @default 50
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.5
* @productversion Flex 4.5
*
*/
<a href="Style%28name%3D%26quot%3BrotationInterval%26quot%3B%2C%20type%3D%26quot%3BNumber%26quot%3B%2C%20format%3D%26quot%3BTime%26quot%3B%2C%20inherit%3D%26quot%3Bno%26quot%3B%29">Style(name="rotationInterval", type="Number", format="Time", inherit="no")</a>
/**
* Color of any symbol of a component.
* This is used by the BusyIndicator to color the spokes of the spinner.
*
* @default 0x000000
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
<a href="Style%28name%3D%26quot%3BsymbolColor%26quot%3B%2C%20type%3D%26quot%3Buint%26quot%3B%2C%20format%3D%26quot%3BColor%26quot%3B%2C%20inherit%3D%26quot%3Byes%26quot%3B%2C%20theme%3D%26quot%3Bspark%2Cmobile%26quot%3B%29">Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark,mobile")</a>
/**
* The BusyIndicator defines a component to display when a long-running
* operation is in progress. This component is a spinner with twelve spokes.
* The color of the spokes is controled by the value of the symbolColor style.
* The transparency of this component can be modified using the alpha property
* but the alpha value of each spoke cannot be modified.
*
* <p>
* The speed at which this component spins is controled by the rotationInterval
* style. The rotationInterval style is the delay in milliseconds between
* rotates. Decrease the rotationInterval to increase the speed of the spin
* and increase the rotationInterval to slow the spin.
* </p>
*
* <p>The BusyIndicator has the following default characteristics:</p>
* <table class="innertable">
* <tr><th>Characteristic</th><th>Description</th></tr>
* <tr><td>Default size</td><td>160 DPI: 26x26 pixels<br>
* 240 DPI: 40x40 pixels<br>
* 320 DPI: 52x52 pixels</td></tr>
* <tr><td>Minimum size</td><td>20x20 pixels</td></tr>
* <tr><td>Maximum size</td><td>No limit</td></tr>
* </table>
*
* The diameter of the BusyIndicator's spinner is the minimum of the width and
* height of the component. The diameter must be an even number so will be
* reduced by one if it is odd.
*
* @mxml
*
* <p>The <code><s:BusyCursor></code> tag inherits the symbolColor style
* and adds the rotationInterval style.</p>
*
* <pre>
* <s:BusyIndicator
*
* <strong>Styles</strong>
* rotationInterval=50
*
* <strong>Spark Styles</strong>
* symbolColor="0x000000"
*
* >
* </pre>
*
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
public class BusyIndicator extends UIComponent
{
//--------------------------------------------------------------------------
//
// Constructor
//
//--------------------------------------------------------------------------
/**
* Constructor.
*
* @langversion 3.0
* @playerversion Flash 10.1
* @playerversion AIR 2.5
* @productversion Flex 4.5
*/
public function BusyIndicator();
The BusyIndicator can be placed in a control bar and set to visible when needed. When not visible or not on the display list the BusyIndicator will not consume any processor cycles.
<s:Panel id="panel" title="Busy Indicator Example"
width="75%" height="75%"
horizontalCenter="0" verticalCenter="0">
<s:controlBarLayout>
<s:HorizontalLayout/>
</s:controlBarLayout>
<s:controlBarContent>
<s:Button label="B1" />
<s:Button label="B2" />
<s:BusyIndicator id="bi" visible="false" />
</s:controlBarContent>
<s:VGroup left="10" right="10" top="10" bottom="10">
<s:Label width="100%" color="blue"
text="Click the Button control to see panel properties."/>
<s:TextArea id="panelPropertyArea" width="100%" height="100%"/>
<s:Button label="Busy" click="{bi.visible = !bi.visible}" />
</s:VGroup>
</s:Panel>
N/A.
If the BusyIndicator is not on the display list or is not visible it will not rotate and consume processor cycles.