Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260317 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/Tween.as
+++ frameworks/projects/framework/src/mx/effects/Tween.as
@@ -52,6 +52,11 @@
  *
  *  @see mx.effects.TweenEffect
  *  @see mx.effects.effectClasses.TweenEffectInstance
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class Tween extends EventDispatcher
 {
@@ -242,6 +247,11 @@
      *
      *  @param endFunction Specifies an alternative end callback function
      *  to be used instead of listener.OnTweenEnd()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function Tween(listener:Object,
                           startValue:Object, endValue:Object,
@@ -378,6 +388,11 @@

     /**
      *  Duration of the animation, in milliseconds.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var duration:Number = 3000;

@@ -387,6 +402,11 @@

     /**
      *  Object that is notified at each interval of the animation.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public var listener:Object;

@@ -462,6 +482,11 @@
      *  @param updateFunction Specifies the update callback function.
      *
      *  @param endFunction Specifies the end callback function.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function setTweenHandlers(updateFunction:Function,
                                      endFunction:Function):void
@@ -499,6 +524,11 @@
      *  in the mx.effects.easing package.

      *
      *  @param easingFunction Function that implements the easing equation.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function set easingFunction(value:Function):void
     {
@@ -508,6 +538,11 @@
     /**
      *  Interrupt the tween, jump immediately to the end of the tween,
      *  and invoke the onTweenEnd() callback function.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function endTween():void
     {
@@ -548,6 +583,11 @@
         {
             startTime += intervalTime - previousUpdateTime - maxDelay;
         }
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
         */
         previousUpdateTime = intervalTime;

@@ -638,6 +678,11 @@
      *
      *  @param playheadTime The position, in milliseconds, between 0
      *  and the value of the duration property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function seek(playheadTime:Number):void
     {
@@ -660,6 +705,11 @@
     /**
      *  Plays the effect in reverse,
      *  starting from the current position of the effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function reverse():void
     {
@@ -677,6 +727,11 @@

     /**
      *  Pauses the effect until you call the resume() method.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function pause():void
     {
@@ -686,6 +741,11 @@
     /**
      *  Stops the tween, ending it without dispatching an event or calling
      *  the Tween's endFunction or onTweenEnd().
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function stop():void
     {
@@ -696,6 +756,11 @@
     /**
      *  Resumes the effect after it has been paused
      *  by a call to the pause() method.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function resume():void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1268406 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/ProgressBar.as
+++ frameworks/projects/mx/src/mx/controls/ProgressBar.as
@@ -0,0 +1,1673 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2002-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls
+{
+
+import flash.display.DisplayObject;
+import flash.display.Graphics;
+import flash.events.Event;
+import flash.events.IEventDispatcher;
+import flash.events.ProgressEvent;
+import flash.events.TimerEvent;
+import flash.text.TextLineMetrics;
+import flash.utils.Timer;
+import mx.core.FlexVersion;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.mx_internal;
+import mx.core.IUITextField;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.events.FlexEvent;
+import mx.styles.ISimpleStyleClient;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the load completes.
+ *
+ *  @eventType flash.events.Event.COMPLETE
+ */
+[Event(name="complete", type="flash.events.Event")]
+
+/**
+ *  Dispatched when an object's state changes from visible to invisible.
+ *
+ *  @eventType mx.events.FlexEvent.HIDE
+ */
+[Event(name="hide", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched as content loads in event
+ *  or polled mode.
+ *
+ *  @eventType flash.events.ProgressEvent.PROGRESS
+ */
+[Event(name="progress", type="flash.events.ProgressEvent")]
+
+/**
+ *  Dispatched when the component becomes visible.
+ *
+ *  @eventType mx.events.FlexEvent.SHOW
+ */
+[Event(name="show", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/BarColorStyle.as"
+include "../styles/metadata/GapStyles.as"
+include "../styles/metadata/LeadingStyle.as"
+include "../styles/metadata/PaddingStyles.as"
+include "../styles/metadata/TextStyles.as"
+
+/**
+ *  Skin style for a determinate progress bar.
+ *
+ *  @default mx.skins.halo.ProgressBarSkin
+ */
+[Style(name="barSkin", type="Class", inherit="no")]
+
+/**
+ *  Black section of a three-dimensional border, or the color section
+ *  of a two-dimensional border.
+ *  @default 0xB7BABC
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no")]
+
+/**
+ *  The number of pixels to move the indeterminate progress bar for each indeterminate loop.
+ *  Once the progress bar has moved the specified number of pixels, it gets respositioned back to
+ *  its starting point. A value of 0 means that the bar is not moved.
+ *
+ *  @default 26
+ */
+[Style(name="indeterminateMoveInterval", type="Number", inherit="no")]
+
+/**
+ *  Skin style for an indeterminate progress bar.
+ *
+ *  @default mx.skins.halo.ProgressIndeterminateSkin
+ */
+[Style(name="indeterminateSkin", type="Class", inherit="no")]
+
+/**
+ *  Skin style for the mask of the determinate and indeterminate bars.
+ *
+ *  @default mx.skins.halo.ProgressMaskSkin
+ */
+[Style(name="maskSkin", type="Class", inherit="no")]
+
+/**
+ *  Skin style for the progress indicator track.
+ *
+ *  @default mx.skins.halo.ProgressTrackSkin
+ */
+[Style(name="trackSkin", type="Class", inherit="no")]
+
+/**
+ *  Theme color of the ProgressBar control.
+ *  Possible values are haloGreen, haloBlue, and haloOrange.
+ *  Adobe recommends setting the themeColor style
+ *  in the <mx:Application> tag, instead of in
+ *  individual controls.
+ *
+ *  @default "haloBlue"
+ */
+[Style(name="themeColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  The colors of the track, as an array of two colors.
+ *  You can use the same color twice for a solid track color.
+ *
+ *  @default [ 0xE6EEEE, 0xE6EEEE ]
+ */
+[Style(name="trackColors", type="Array", arrayType="uint", format="Color", inherit="no")]
+
+/**
+ *  The height of the track in pixels. If the value is NaN, then
+ *  use the height of the skin specified by the trackSkin property.
+ *
+ *  @default NaN
+ */
+[Style(name="trackHeight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The width of the label in pixels. If the value is NaN,
+ *  the ProgressBar control sets it to the width of the control.
+ *
+ *  @default NaN
+ */
+[Style(name="labelWidth", type="Number", format="Length", inherit="yes")]
+
+/**
+ *  Effect called when Flex dispatches the complete event,
+ *  which occurs when the load completes.
+ */
+[Effect(name="completeEffect", event="complete")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[DefaultBindingProperty(source="percentComplete")]
+
+[DefaultTriggerEvent("progress")]
+
+[IconFile("ProgressBar.png")]
+
+[ResourceBundle("controls")]
+
+/**
+ *  The ProgressBar control provides a visual representation of the progress of a task over
+ *  time. There are two types of ProgressBar controls: determinate and indeterminate.
+ *
+ *
A determinate ProgressBar control is a linear representation of the progress of a task over time.
+ *  You use a determinate ProgressBar when the scope of the task is known. It displays when the user
+ *  has to wait for an extended amount of time.

+ *
+ *
An indeterminate ProgressBar control represents time-based processes for which the scope is
+ *  not yet known. As soon as you can determine the scope,
+ *  you should use a determinate ProgressBar control.

+ *
+ *
The ProgressBar control has the following default characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           default size
+ *           150 pixels wide by 4 pixels high
+ *

+ *

+ *           Minimum size
+ *           0 pixels
+ *

+ *

+ *           Maximum size
+ *           Undefined
+ *

+ *

+ *
+ *  @mxml
+ *
+ *
The <mx:ProgressBar> tag inherits all of the tag attributes
+ *  of its superclass, and adds the following tag attributes:

+ *
+ *

+ *  <mx:ProgressBar
+ *    Properties
+ *    conversion="1"
+ *    direction="right|left"
+ *    indeterminate="false|true"
+ *    label="No default"
+ *    labelPlacement="bottom|top|left|right|center"
+ *    maximum="0"
+ *    minimum="0"
+ *    mode="event|polled|manual"
+ *    source="No default"
+ *
+ *    Styles
+ *    barColor="undefined"
+ *    barSkin="ProgressBarSkin"
+ *    borderColor="0xAAB3B3"
+ *    color="0x0B333C"
+ *    disabledColor="0xAAB3B3"
+ *    fontAntiAliasType="advanced"
+ *    fontFamily="Verdana"
+ *    fontGridFitType="pixel"
+ *    fontSharpness="0"
+ *    fontSize="10"
+ *    fontThickness="0"
+ *    fontStyle="normal|italic"
+ *    fontWeight="normal|bold"
+ *    horizontalGap="8"
+ *    indeterminateMoveInterval="26"
+ *    indeterminateSkin="ProgressIndeterminateSkin"
+ *    labelWidth="Computed"
+ *    leading="0"
+ *    maskSkin="ProgressMaskSkin"
+ *    paddingLeft="0"
+ *    paddingRight="0"
+ *    textAlign="left|right|center"
+ *    textDecoration="none|underline"
+ *    textIndent="0"
+ *    themeColor="haloGreen|haloBlue|haloOrange"
+ *    trackColors="[0xE6EEEE,0xE6EEEE]"
+ *    trackHeight="Calculated"
+ *    trackSkin="ProgressTrackSkin"
+ *    verticalGap="6"
+ *
+ *    Events
+ *    complete="No default"
+ *    hide="No default"
+ *    progress="No default"
+ *    show="No default"
+ *
+ *    Effects
+ *    completeEffect="No default"
+ *  />
+ *

+ *

+ *
+ *  @see mx.controls.ProgressBarDirection
+ *  @see mx.controls.ProgressBarLabelPlacement
+ *  @see mx.controls.ProgressBarMode
+ *
+ *  @includeExample examples/SimpleProgressBar.mxml
+ */
+public class ProgressBar extends UIComponent implements IFontContextComponent
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function ProgressBar()
+    {
+        super();
+
+        pollTimer = new Timer(_interval);
+        cacheAsBitmap = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    mx_internal var _content:UIComponent;
+
+    /**
+     *  @private
+     */
+    mx_internal var _bar:UIComponent;
+
+    /**
+     *  @private
+     */
+    mx_internal var _indeterminateBar:IFlexDisplayObject;
+
+    /**
+     *  @private
+     */
+    mx_internal var _determinateBar:IFlexDisplayObject;
+
+    /**
+     *  @private
+     */
+    mx_internal var _track:IFlexDisplayObject;
+
+    /**
+     *  @private
+     */
+    mx_internal var _barMask:IFlexDisplayObject;
+
+    /**
+     *  @private
+     */
+    mx_internal var _labelField:IUITextField;
+
+    /**
+     *  @private
+     */
+    private var pollTimer:Timer;
+
+    /**
+     *  @private
+     */
+    private var _interval:Number = 30;
+
+    /**
+     *  @private
+     */
+    private var indeterminatePlaying:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var stopPolledMode:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var barSkinChanged:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var trackSkinChanged:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var indeterminateSkinChanged:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var visibleChanged:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  conversion
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the conversion property.
+     */
+    private var _conversion:Number = 1;
+
+    [Bindable("conversionChanged")]
+    [Inspectable(defaultValue="1")]
+
+    /**
+     *  Number used to convert incoming current bytes loaded value and
+     *  the total bytes loaded values.
+     *  Flex divides the current and total values by this property and
+     *  uses the closest integer that is less than or equal to each
+     *  value in the label string. A value of 1 does no conversion.
+     *
+     *  @default 1
+     */
+    public function get conversion():Number
+    {
+        return _conversion;
+    }
+
+    /**
+     *  @private
+     */
+    public function set conversion(value:Number):void
+    {
+        if (!isNaN(value) && Number(value) > 0 && value != _conversion)
+        {
+            _conversion = Number(value);
+
+            invalidateDisplayList();
+
+            dispatchEvent(new Event("conversionChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  direction
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the direction property.
+     */
+    private var _direction:String = ProgressBarDirection.RIGHT;
+
+    [Bindable("directionChanged")]
+    [Inspectable(enumeration="left,right", defaultValue="right")]
+
+    /**
+     *  Direction in which the fill of the ProgressBar expands toward completion.
+     *  Valid values in MXML are
+     *  "right" and "left".
+     *
+     *
In ActionScript, you use use the following constants
+     *  to set this property:
+     *  ProgressBarDirection.RIGHT and
+     *  ProgressBarDirection.LEFT.

+     *
+     *  @see mx.controls.ProgressBarDirection
+     *  @default ProgressBarDirection.RIGHT
+     */
+    public function get direction():String
+    {
+        return _direction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set direction(value:String):void
+    {
+        if (value == ProgressBarDirection.LEFT || value == ProgressBarDirection.RIGHT)
+            _direction = value;
+
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("directionChanged"));
+    }
+
+    //----------------------------------
+    //  fontContext
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public function get fontContext():IFlexModuleFactory
+    {
+        return moduleFactory;
+    }
+
+    /**
+     *  @private
+     */
+    public function set fontContext(moduleFactory:IFlexModuleFactory):void
+    {
+        this.moduleFactory = moduleFactory;
+    }
+
+    //----------------------------------
+    //  indeterminate
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the indeterminate property.
+     */
+    private var _indeterminate:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var indeterminateChanged:Boolean = true;
+
+    [Bindable("indeterminateChanged")]
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Whether the ProgressBar control has a determinate or
+     *  indeterminate appearance.
+     *  Use an indeterminate appearance when the progress status cannot be determined.
+     *  If true, the appearance is indeterminate.
+     *
+     *  @default false
+     */
+    public function get indeterminate():Boolean
+    {
+        return _indeterminate;
+    }
+
+    /**
+     *  @private
+     */
+    public function set indeterminate(value:Boolean):void
+    {
+        _indeterminate = value;
+        indeterminateChanged = true;
+
+        invalidateProperties();
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("indeterminateChanged"));
+    }
+
+    //----------------------------------
+    //  label
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the label property.
+     */
+    private var _label:String;
+
+    /**
+     *  @private
+     */
+    private var labelOverride:String;
+
+    [Bindable("labelChanged")]
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Text that accompanies the progress bar. You can include
+     *  the following special characters in the text string:
+     *
+     *

+     *
%1 = current loaded bytes

+     *
%2 = total bytes

+     *
%3 = percent loaded

+     *
%% = "%" character

+     *

+     *
+     *
If a field is unknown, it is replaced by "??".
+     *  If undefined, the label is not displayed.

+     *
+     *  @default "LOADING %3%%"
+     */
+    public function get label():String
+    {
+        return _label;
+    }
+
+    /**
+     *  @private
+     */
+    public function set label(value:String):void
+    {
+        labelOverride = value;
+
+        _label = value != null ?
+                 value :
+                 resourceManager.getString(
+                     "controls", "label");
+
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("labelChanged"));
+    }
+
+    //----------------------------------
+    //  labelPlacement
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the labelPlacement property.
+     */
+    private var _labelPlacement:String = ProgressBarLabelPlacement.BOTTOM;
+
+    [Bindable("labelPlacementChanged")]
+    [Inspectable(category="General", enumeration="left,right,top,bottom,center", defaultValue="bottom")]
+
+    /**
+     *  Placement of the label.
+     *  Valid values in MXML are "right", "left",
+     *  "bottom", "center", and "top".
+     *
+     *
In ActionScript, you can use use the following constants to set this property:
+     *  ProgressBarLabelPlacement.RIGHT, ProgressBarLabelPlacement.LEFT,
+     *  ProgressBarLabelPlacement.BOTTOM, ProgressBarLabelPlacement.CENTER,
+     *  and ProgressBarLabelPlacement.TOP.

+     *
+     *  @see mx.controls.ProgressBarLabelPlacement
+     *  @default ProgressBarLabelPlacement.BOTTOM
+     */
+    public function get labelPlacement():String
+    {
+        return _labelPlacement;
+    }
+
+    /**
+     *  @private
+     */
+    public function set labelPlacement(value:String):void
+    {
+        if (value != _labelPlacement)
+            _labelPlacement = value;
+
+        invalidateSize();
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("labelPlacementChanged"));
+    }
+
+    //----------------------------------
+    //  maximum
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the maximum property.
+     */
+    private var _maximum:Number = 0;
+
+    [Bindable("maximumChanged")]
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  Largest progress value for the ProgressBar. You
+     *  can only use this property in manual mode.
+     *
+     *  @default 0
+     */
+    public function get maximum():Number
+    {
+        return _maximum;
+    }
+
+    /**
+     *  @private
+     */
+    public function set maximum(value:Number):void
+    {
+        if (!isNaN(value) && _mode == ProgressBarMode.MANUAL && value != _maximum)
+        {
+            _maximum = value;
+            invalidateDisplayList();
+            dispatchEvent(new Event("maximumChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  minimum
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the minimum property.
+     */
+    private var _minimum:Number = 0;
+
+    [Bindable("minimumChanged")]
+    [Inspectable(category="General", defaultValue="0")]
+
+    /**
+     *  Smallest progress value for the ProgressBar. This
+     *  property is set by the developer only in manual mode.
+     *
+     *  @default 0
+     */
+    public function get minimum():Number
+    {
+        return _minimum;
+    }
+
+    /**
+     *  @private
+     */
+    public function set minimum(value:Number):void
+    {
+        if (!isNaN(value) && _mode == ProgressBarMode.MANUAL && value != _minimum)
+        {
+            _minimum = value;
+
+            invalidateDisplayList();
+
+            dispatchEvent(new Event("minimumChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  mode
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the mode property.
+     */
+    private var _mode:String = ProgressBarMode.EVENT;
+
+    /**
+     *  @private
+     */
+    private var modeChanged:Boolean = false;
+
+    [Bindable("modeChanged")]
+    [Inspectable(category="General", enumeration="event,polled,manual", defaultValue="event")]
+
+    /**
+     *  Specifies the method used to update the bar.
+     *  Use one of the following values in MXML:
+     *
+     *

+     *
event The control specified by the source
+     *    property must dispatch progress and completed events.
+     *    The ProgressBar control uses these events to update its status.
+     *    The ProgressBar control only updates if the value of
+     *    the source property extends the EventDispatcher class.

+     *
+     *
polled The source property must specify
+     *    an object that exposes bytesLoaded and
+     *    bytesTotal properties. The ProgressBar control
+     *    calls these methods to update its status.

+     *
+     *
manual You manually update the ProgressBar status.
+     *    In this mode you specify the maximum and minimum
+     *    properties and use the setProgress() property method to
+     *    specify the status. This mode is often used when the indeterminate
+     *    property is true.

+     *

+     *
+     *
In ActionScript, you can use use the following constants to set this property:
+     *  ProgressBarMode.EVENT, ProgressBarMode.POLLED,
+     *  and ProgressBarMode.MANUAL.

+     *
+     *  @see mx.controls.ProgressBarMode
+     *
+     *  @default ProgressBarMode.EVENT
+     */
+    public function get mode():String
+    {
+        return _mode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set mode(value:String):void
+    {
+        if (value != _mode)
+        {
+            if (_mode == ProgressBarMode.POLLED)
+                stopPolledMode = true;
+
+            _mode = value;
+
+            modeChanged = true;
+            indeterminateChanged = true;
+
+            invalidateProperties();
+            invalidateDisplayList();
+        }
+    }
+
+    //----------------------------------
+    //  percentComplete
+    //----------------------------------
+
+    [Bindable("progress")]
+
+    /**
+     *  Percentage of process that is completed.The range is 0 to 100.
+     *  Use the setProgress() method to change the percentage.
+     */
+    public function get percentComplete():Number
+    {
+        if (_value < _minimum || _maximum < _minimum)
+            return 0;
+
+        // Avoid divide by zero fault.
+        if ((_maximum - _minimum) == 0)
+            return 0;
+
+        var perc:Number = 100 * (_value - _minimum) / (_maximum - _minimum);
+
+        if (isNaN(perc) || perc < 0)
+            return 0;
+        else if (perc > 100)
+            return 100;
+        else
+            return perc;
+    }
+
+    //----------------------------------
+    //  source
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the source property.
+     */
+    private var _source:Object;
+
+    /**
+     *  @private
+     */
+    private var _stringSource:String;
+
+    /**
+     *  @private
+     */
+    private var sourceChanged:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var stringSourceChanged:Boolean = false;
+
+    [Bindable("sourceChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Refers to the control that the ProgressBar is measuring the progress of. Use this property only in
+     *  event and polled mode. A typical usage is to set this property to a Loader control.
+     */
+    public function get source():Object
+    {
+        return _source;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:Object):void
+    {
+        if (value is String)
+        {
+            _stringSource = String(value);
+            try
+            {
+                value = document[_stringSource];
+            }
+            catch(e:Error)
+            {
+                stringSourceChanged = true; // Try again in commitProperties
+            }
+        }
+
+        if (value)
+        {
+            _source = value;
+            sourceChanged = true;
+            modeChanged = true;
+            indeterminateChanged = true;
+            invalidateProperties();
+            invalidateDisplayList();
+        }
+        else if (_source != null)
+        {
+            _source = null;
+            sourceChanged = true;
+            indeterminateChanged = true;
+            invalidateProperties();
+            invalidateDisplayList();
+            pollTimer.reset();
+        }
+    }
+
+    //----------------------------------
+    //  value
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the value property.
+     */
+    private var _value:Number = 0;
+
+    [Bindable("change")]
+
+    /**
+     *  Read-only property that contains the amount of progress
+     *  that has been made - between the minimum and maximum values.
+     */
+    public function get value():Number
+    {
+        return _value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set visible(value:Boolean):void
+    {
+        super.visible = value;
+
+        visibleChanged = true;
+        invalidateDisplayList();
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        if (!_content)
+        {
+            _content = new UIComponent();
+            addChild(_content);
+        }
+
+        if (!_bar)
+        {
+            _bar = new UIComponent();
+            _content.addChild(_bar);
+        }
+
+        if (!_barMask)
+        {
+            if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+            {
+                var barMaskClass:Class = getStyle("maskSkin");
+                _barMask = new barMaskClass();
+            }
+            else
+            {
+                _barMask = new UIComponent();
+            }
+
+            _barMask.visible = true;
+            _bar.addChild(DisplayObject(_barMask));
+            UIComponent(_bar).mask = DisplayObject(_barMask);
+        }
+
+
+        if (!_labelField)
+        {
+            _labelField = IUITextField(createInFontContext(UITextField));
+            _labelField.styleName = this;
+            addChild(DisplayObject(_labelField));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function childrenCreated():void
+    {
+        super.childrenCreated();
+
+        // Mark all of our skins as changed so they will get created.
+        trackSkinChanged = true;
+        barSkinChanged = true;
+        indeterminateSkinChanged = true;
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        var invalidate:Boolean = false;
+
+        super.styleChanged(styleProp);
+
+        if (styleProp == null || styleProp == "styleName")
+        {
+            // Wholesale change, need to update all skins
+            barSkinChanged = trackSkinChanged = indeterminateSkinChanged = true;
+            invalidate = true;
+        }
+        else if (styleProp == "barSkin")
+        {
+            barSkinChanged = true;
+            invalidate = true;
+        }
+        else if (styleProp == "trackSkin")
+        {
+            trackSkinChanged = true;
+            invalidate = true;
+        }
+        else if (styleProp == "indeterminateSkin")
+        {
+            indeterminateSkinChanged = true;
+            invalidate = true;
+        }
+
+        if (invalidate)
+        {
+            invalidateProperties();
+            invalidateSize();
+            invalidateDisplayList();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // if the font changed and we already created the label, we will need to
+        // destory it so it can be re-created, possibly in a different swf context.
+        if (hasFontContextChanged() && _labelField != null)
+        {
+            var index:int = getChildIndex(DisplayObject(_labelField));
+            removeChild(DisplayObject(_labelField));
+            _labelField = IUITextField(createInFontContext(UITextField));
+            _labelField.styleName = this;
+            addChildAt(DisplayObject(_labelField), index);
+        }
+
+
+        if (trackSkinChanged)
+        {
+            trackSkinChanged = false;
+            createTrack();
+        }
+
+        if (barSkinChanged)
+        {
+            barSkinChanged = false;
+            createBar();
+        }
+
+        if (indeterminateSkinChanged)
+        {
+            indeterminateSkinChanged = false;
+            createIndeterminateBar();
+        }
+
+        if (stringSourceChanged)
+        {
+            stringSourceChanged = false;
+            try
+            {
+                _source = document[_stringSource];
+            }
+            catch(e:Error)
+            {
+                // If we fail here, then the source refers to an object that doesn't exist
+                // on the document
+            }
+        }
+
+        if (sourceChanged)
+        {
+            sourceChanged = false;
+            dispatchEvent(new Event("sourceChanged"));
+        }
+
+        if (modeChanged)
+        {
+            modeChanged = false;
+            if (_source)
+            {
+                if (_mode == ProgressBarMode.EVENT)
+                {
+                    if (_source is IEventDispatcher)
+                    {
+                        _source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+                        _source.addEventListener(Event.COMPLETE, completeHandler);
+                    }
+                    else
+                    {
+                        // the Loader object is not yet initialized properly,
+                        // as it is put on stage after the progressbar
+                        // so make it go thru the source re-setting in draw
+                        _source = null;
+                    }
+                }
+                else
+                {
+                    _source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
+                    _source.removeEventListener(Event.COMPLETE, completeHandler);
+                }
+            }
+
+            if (_mode == ProgressBarMode.POLLED)
+            {
+            	// weak listener in case the pbar is removed before the timer is reset()
+            	// safe because pollTimer lives in the pbar
+                pollTimer.addEventListener(TimerEvent.TIMER, updatePolledHandler, false, 0, true);
+                pollTimer.start();
+            }
+            else if (stopPolledMode)
+            {
+                stopPolledMode = false;
+                pollTimer.removeEventListener(TimerEvent.TIMER, updatePolledHandler);
+                pollTimer.reset();
+            }
+
+            dispatchEvent(new Event("modeChanged"));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        var prefWidth:Number;
+        var prefHeight:Number;
+
+        var minWidth:Number = NaN;
+        var minHeight:Number = NaN;
+
+        var trackHeight:Number = getStyle("trackHeight");
+
+        var preferredTrackWidth:Number = _track.measuredWidth;
+        var preferredTrackHeight:Number = isNaN(trackHeight) ?
+                                          _track.measuredHeight:
+                                          trackHeight;
+
+        var horizontalGap:Number = getStyle("horizontalGap");
+        var verticalGap:Number = getStyle("verticalGap");
+
+        var paddingLeft:Number = getStyle("paddingLeft");
+        var paddingRight:Number = getStyle("paddingRight");
+        var paddingTop:Number = getStyle("paddingTop");
+        var paddingBottom:Number = getStyle("paddingBottom");
+
+        var labelWidth:Number = getStyle("labelWidth");
+
+        var lineMetrics:TextLineMetrics = measureText(predictLabelText());
+
+        var textWidth:Number = isNaN(labelWidth) ?
+                               lineMetrics.width + UITextField.TEXT_WIDTH_PADDING :
+                               labelWidth;
+        var textHeight:Number = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+        switch (labelPlacement)
+        {
+            case ProgressBarLabelPlacement.LEFT:
+            case ProgressBarLabelPlacement.RIGHT:
+            {
+                prefWidth = textWidth + preferredTrackWidth +
+                            paddingLeft + paddingRight + horizontalGap;
+                prefHeight = Math.max(textHeight,preferredTrackHeight) +
+                             paddingTop + paddingBottom;
+                measuredMinWidth = prefWidth;
+                break;
+            }
+
+            case ProgressBarLabelPlacement.CENTER:
+            {
+                prefWidth = Math.max(textWidth, preferredTrackWidth) +
+                            paddingLeft + paddingRight + horizontalGap;
+                prefHeight = Math.max(textHeight,preferredTrackHeight) +
+                             paddingTop + paddingBottom;
+                measuredMinWidth = textWidth;
+                break;
+            }
+            default: /* ProgressBarLabelPlacement.TOP && ProgressBarLabelPlacement.BOTTOM */
+            {
+                prefWidth = Math.max(textWidth, preferredTrackWidth) +
+                            paddingLeft + paddingRight;
+                prefHeight = textHeight + preferredTrackHeight +
+                             paddingTop + paddingBottom + verticalGap;
+                measuredMinWidth = textWidth;
+                break;
+            }
+        }
+
+        measuredWidth = prefWidth;
+        measuredMinHeight = measuredHeight = prefHeight;
+
+        if (!isNaN(minWidth))
+            measuredMinWidth = minWidth;
+        if (!isNaN(minHeight))
+            measuredMinHeight = minHeight;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var horizontalGap:Number = getStyle("horizontalGap");
+        var verticalGap:Number = getStyle("verticalGap");
+
+        var paddingLeft:Number = getStyle("paddingLeft");
+        var paddingRight:Number = getStyle("paddingRight");
+        var paddingTop:Number = getStyle("paddingTop");
+        var paddingBottom:Number = getStyle("paddingBottom");
+
+        var left:Number = paddingLeft;
+        var top:Number = paddingTop;
+
+        var labelWidth:Number = getStyle("labelWidth");
+        var trackHeight:Number = getStyle("trackHeight");
+
+        trackHeight = isNaN(trackHeight) ?
+                      _track.measuredHeight :
+                      trackHeight;
+
+        var lineMetrics:TextLineMetrics = measureText(predictLabelText());
+
+        var textWidth:Number = isNaN(labelWidth) ?
+                               lineMetrics.width + UITextField.TEXT_WIDTH_PADDING :
+                               labelWidth;
+
+        var textHeight:Number = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+
+        switch (labelPlacement)
+        {
+            case ProgressBarLabelPlacement.TOP:
+            {
+                _labelField.move(left,top);
+                _labelField.setActualSize(textWidth, textHeight);
+                _content.move(left, top + textHeight + verticalGap);
+                layoutContent(unscaledWidth - left - paddingRight, trackHeight);
+                break;
+            }
+
+            case ProgressBarLabelPlacement.RIGHT:
+            {
+                var cWidth:Number = unscaledWidth - left -
+                                    paddingRight - textWidth - horizontalGap;
+                _labelField.move(left + cWidth + horizontalGap,
+                                 (unscaledHeight - textHeight) / 2);
+                _labelField.setActualSize(textWidth, textHeight);
+                _content.move(left,top + (textHeight - trackHeight) / 2);
+                layoutContent(cWidth, trackHeight);
+                break;
+            }
+
+            case ProgressBarLabelPlacement.LEFT:
+            {
+                _labelField.move(left, top + (unscaledHeight - textHeight) / 2);
+                _labelField.setActualSize(textWidth, textHeight);
+                _content.move(left + textWidth + horizontalGap,
+                              top + (textHeight - trackHeight) / 2);
+                layoutContent(unscaledWidth - left - textWidth -
+                              verticalGap - paddingRight, trackHeight);
+                break;
+            }
+
+            case ProgressBarLabelPlacement.CENTER:
+            {
+                _labelField.move((unscaledWidth - textWidth) / 2,
+                                 (unscaledHeight - textHeight) / 2);
+                _labelField.setActualSize(textWidth, textHeight);
+                _content.move(left,top);
+                layoutContent(unscaledWidth - paddingRight,
+                              unscaledHeight - paddingBottom);
+                break;
+            }
+
+            default: /* case ProgressBarLabelPlacement.BOTTOM */
+            {
+                _labelField.move(left,top + trackHeight + verticalGap);
+                _labelField.setActualSize(textWidth, textHeight);
+                _content.move(left, top);
+                layoutContent(unscaledWidth - left - paddingRight, trackHeight);
+                break;
+            }
+        }
+
+        //layout mask
+        if (_barMask)
+        {
+            _barMask.move(0,0);
+
+            if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
+            {
+                _barMask.setActualSize(_track.width, _track.height);
+            }
+            else
+            {
+                var g:Graphics = UIComponent(_barMask).graphics;
+                g.clear();
+                g.beginFill(0xFFFF00);
+                g.drawRect(1, 1, _track.width - 2, _track.height - 2);
+                g.endFill();
+            }
+        }
+        // Print position/sizes of children
+        //trace("_labelField x",_labelField.x,"y",_labelField.y,"w",_labelField.width,"h",_labelField.height);
+        //trace("_content x",_content.x,"y",_content.y,"w",_content.width,"h",_content.height);
+
+        _labelField.text = getFullLabelText();
+        // TODO redundant? the IF below does this
+        _indeterminateBar.visible = _indeterminate;
+
+        if (indeterminateChanged || visibleChanged)
+        {
+            indeterminateChanged = false;
+            visibleChanged = false;
+
+            _indeterminateBar.visible = _indeterminate;
+
+            if (_indeterminate && _source == null && _mode == ProgressBarMode.EVENT && visible)
+                startPlayingIndeterminate();
+            else
+                stopPlayingIndeterminate();
+        }
+
+        if (_indeterminate)
+        {
+            _determinateBar.setActualSize(_track.width, _track.height);
+        }
+        else
+        {
+            var w:Number = Math.max(0, _track.width * percentComplete / 100);
+            _determinateBar.setActualSize(w, _track.height);
+            _determinateBar.x = direction == ProgressBarDirection.RIGHT ?
+                                0 :
+                                _track.width - w;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function resourcesChanged():void
+    {
+        super.resourcesChanged();
+
+        label = labelOverride;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Sets the state of the bar to reflect the amount of progress made
+     *  when using manual mode.
+     *  The value argument is assigned to the value
+     *  property and the maximum argument is assigned to the
+     *  maximum property.
+     *  The minimum property is not altered.
+     *
+     *  @param value Current value.
+     *
+     *  @param maximum Total or target value.
+     */
+    public function setProgress(value:Number, total:Number):void
+    {
+        if (_mode == ProgressBarMode.MANUAL)
+            _setProgress(value, total);
+    }
+
+    /**
+     *  @private
+     *  Changes the value and the maximum properties.
+     */
+    private function _setProgress(value:Number, maximum:Number):void
+    {
+        if (enabled && !isNaN(value) && !isNaN(maximum))
+        {
+            _value = value;
+            _maximum = maximum;
+
+            // Dipatch an Event of type "change".
+            dispatchEvent(new Event(Event.CHANGE));
+
+            // Dispatch a Progress
+            var progressEvent:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS);
+            progressEvent.bytesLoaded = value;
+            progressEvent.bytesTotal = maximum;
+            dispatchEvent(progressEvent);
+
+            if (_indeterminate)
+                startPlayingIndeterminate();
+
+            if (_value == _maximum && _value > 0)
+            {
+                if (_indeterminate)
+                    stopPlayingIndeterminate();
+
+                if (mode != ProgressBarMode.EVENT) // We get our own complete event when in event mode
+                    dispatchEvent(new Event(Event.COMPLETE));
+            }
+
+            invalidateDisplayList();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function createTrack():void
+    {
+        if (_track)
+        {
+            _content.removeChild(DisplayObject(_track));
+            _track = null;
+        }
+
+        // Create the track frame
+        var trackClass:Class = getStyle('trackSkin');
+        if (trackClass)
+        {
+            _track = new trackClass();
+            if (_track is ISimpleStyleClient)
+                ISimpleStyleClient(_track).styleName = this;
+            _content.addChildAt(DisplayObject(_track), 0);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function createBar():void
+    {
+        if (_determinateBar)
+        {
+            _bar.removeChild(DisplayObject(_determinateBar));
+            _determinateBar = null;
+        }
+
+        // Create the determinate bar
+        var barClass:Class = getStyle('barSkin');
+        if (barClass)
+        {
+            _determinateBar = new barClass();
+            if (_determinateBar is ISimpleStyleClient)
+                ISimpleStyleClient(_determinateBar).styleName = this;
+            _bar.addChild(DisplayObject(_determinateBar));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function createIndeterminateBar():void
+    {
+        if (_indeterminateBar)
+        {
+            _bar.removeChild(DisplayObject(_indeterminateBar));
+            _indeterminateBar = null;
+        }
+
+        // Create the indeterminate bar
+        var indeterminateClass:Class = getStyle('indeterminateSkin');
+        if (indeterminateClass)
+        {
+            _indeterminateBar = new indeterminateClass();
+            if (_indeterminateBar is ISimpleStyleClient)
+                ISimpleStyleClient(_indeterminateBar).styleName = this;
+            _indeterminateBar.visible = false;
+            _bar.addChild(DisplayObject(_indeterminateBar));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function layoutContent(newWidth:Number, newHeight:Number):void
+    {
+        _track.move(0, 0);
+        _track.setActualSize(newWidth, newHeight);
+
+        _bar.move(0, 0);
+        _determinateBar.move(0, 0);
+        _indeterminateBar.setActualSize(newWidth + getStyle("indeterminateMoveInterval"), newHeight);
+    }
+
+    /**
+     *  @private
+     */
+    private function getFullLabelText():String
+    {
+        var current:Number = Math.max(_value /* - _minimum */,0);
+        var total:Number = Math.max(_maximum /* - _minimum */,0);
+        var labelText:String = label;
+
+        if (labelText)
+        {
+            if (_indeterminate)
+            {
+                labelText = labelText.replace("%1", String(Math.floor(current / _conversion)));
+                labelText = labelText.replace("%2", "??");
+                labelText = labelText.replace("%3", "");
+                labelText = labelText.replace("%%", "");
+            }
+            else
+            {
+                labelText = labelText.replace("%1", String(Math.floor(current / _conversion)));
+                labelText = labelText.replace("%2", String(Math.floor(total / _conversion)));
+                labelText = labelText.replace("%3", String(Math.floor(percentComplete)));
+                labelText = labelText.replace("%%", "%");
+            }
+        }
+
+        return labelText;
+    }
+
+    /**
+     *  @private
+     *  Make a good guess at the largest size of the label based on which placeholders are present
+     */
+    private function predictLabelText():String
+    {
+        // The label will be null if there are no resources.
+        if (label == null)
+            return "";
+
+        var labelText:String = label;
+
+        var largestValue:Number;
+        if (_maximum != 0)
+            largestValue = _maximum;
+        else
+            largestValue = 100000;
+
+        if (labelText)
+        {
+            if (_indeterminate)
+            {
+                labelText = labelText.replace("%1", String(Math.floor(largestValue / _conversion)));
+                labelText = labelText.replace("%2", "??");
+                labelText = labelText.replace("%3", "");
+                labelText = labelText.replace("%%", "");
+            }
+            else
+            {
+                labelText = labelText.replace("%1", String(Math.floor(largestValue / _conversion)));
+                labelText = labelText.replace("%2", String(Math.floor(largestValue / _conversion)));
+                labelText = labelText.replace("%3", "100");
+                labelText = labelText.replace("%%", "%");
+            }
+        }
+
+        var actualText:String = getFullLabelText();
+
+        // Return the longer of the two strings
+        if (labelText.length > actualText.length)
+            return labelText;
+        else
+            return actualText;
+    }
+
+    /**
+     *  @private
+     */
+    private function startPlayingIndeterminate():void
+    {
+        if (!indeterminatePlaying)
+        {
+            indeterminatePlaying = true;
+
+			// weak listener in case the pbar is removed before the timer is reset()
+            // safe because pollTimer lives in the pbar
+            pollTimer.addEventListener(TimerEvent.TIMER, updateIndeterminateHandler, false, 0, true);
+            pollTimer.start();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function stopPlayingIndeterminate():void
+    {
+        if (indeterminatePlaying)
+        {
+            indeterminatePlaying = false;
+
+            pollTimer.removeEventListener(TimerEvent.TIMER, updateIndeterminateHandler);
+
+            if (_mode != ProgressBarMode.POLLED)
+                pollTimer.reset();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  "progress" event handler for event mode
+     */
+    private function progressHandler(event:ProgressEvent):void
+    {
+        _setProgress(event.bytesLoaded, event.bytesTotal);
+    }
+
+    /**
+     *  @private
+     *  "complete" event handler for event mode
+     */
+    private function completeHandler(event:Event):void
+    {
+        dispatchEvent(event);
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
+     */
+    private function updateIndeterminateHandler(event:Event):void
+    {
+        if (_indeterminateBar.x < 1)
+            _indeterminateBar.x += 1;
+        else
+            _indeterminateBar.x = - (getStyle("indeterminateMoveInterval") - 2);
+    }
+
+    /**
+     *  @private
+     *  Callback method for polled mode.
+     */
+    private function updatePolledHandler(event:Event):void
+    {
+        if (_source)
+        {
+            var comp:Object = _source;
+
+            var bytesLoaded:Number = comp.bytesLoaded;
+            var bytesTotal:Number = comp.bytesTotal;
+
+            if (!isNaN(bytesLoaded) && !isNaN(bytesTotal))
+            {
+                _setProgress(bytesLoaded, bytesTotal);
+
+                // 0 is the size of an empty movie clip??
+                if (percentComplete >= 100 && _value > 0)
+                    pollTimer.reset();
+            }
+        }
+    }
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 5770
Author:   gruehle@adobe.com
Date:     2009-03-30T20:58:54.529722Z

Log Message:
-----------
Add [Alternative] metadata to the Halo components that have a Gumbo replacement.

Bugs: SDK-20190
QA notes: none
Doc notes: Additional ASDoc comments added for many of the classes. These should all be reviewed.
Reviewer: Chet

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TileList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Zoom.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Cubic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/RemoveChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/TweenEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeRight.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Glow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quartic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeLeft.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quintic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Tween.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/easing/Quadratic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/AddChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeDown.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/SetPropertyAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Blur.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Text.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/HorizontalList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/WipeUp.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1269453 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/effects/easing/Cubic.as
+++ frameworks/projects/mx/src/mx/effects/easing/Cubic.as
@@ -11,6 +11,15 @@

 package mx.effects.easing
 {
+
+/**
+ *  The new effects provided as of Flex 4 use classes which implement the
+ *  IEaser interface instead of the easing functions in classes like Cubic for
+ *  the earlier Flex 3 effects. To achieve the same functionality of Cubic,
+ *  create a Power instance with an exponent of 3 and set the
+ *  easeInFraction appropriately to get the desired result.
+ */
+[Alternative(replacement="spark.effects.easing.Power", since="4.0")]

 /**
  *  The Cubic class defines three easing functions to implement


Transferred from the Adobe Open Source Subversion Repository

Revision: 5573
Author:   jimurphy@adobe.com
Date:     2009-03-26T15:11:59.159776Z

Log Message:
-----------
-more updated package and class names that were missed in the first pass
-remove the mx folder

qa: probably
doc: this updated more asdoc comments so you may want to make sure that this pass made the correct updates
checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/SetActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/IEaser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/DataGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/pathSegments/PathSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxToggleButtonExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/AnimationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/WipeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SetAction.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283263 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/core/IViewport.as
+++ frameworks/projects/spark/src/spark/core/IViewport.as
@@ -106,7 +106,7 @@
      *  Returns the amount one would have to add to the viewport's current
      *  horizontalScrollPosition to scroll by the requested "scrolling" unit.
      *
-     *  The value of unit must be one of the following mx.core.ScrollUnit
+     *  The value of unit must be one of the following spark.core.ScrollUnit
      *  constants: LEFT, RIGHT, PAGE_LEFT, PAGE_RIGHT, HOME, END.
      *
      *  To scroll by a single column use LEFT or RIGHT and to scroll to the
@@ -125,7 +125,7 @@
      *  Returns the amount one would have to add to the viewport's current
      *  verticalScrollPosition to scroll by the requested "scrolling" unit.
      *
-     *  The value of unit must be one of the following mx.core.ScrollUnit
+     *  The value of unit must be one of the following spark.core.ScrollUnit
      *  constants: UP, DOWN, PAGE_UP, PAGE_DOWN, HOME, END.
      *
      *  To scroll by a single row use UP or DOWN and to scroll to the


Transferred from the Adobe Open Source Subversion Repository

Revision: 12060
Author:   aharui@adobe.com
Date:     2009-11-20T20:12:21.522473Z

Log Message:
-----------
Fix dependency issues

QE Notes: None
Doc Notes: None
Bugs: SDK-24353, SDK-24354
Reviewer: Corey
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/gumbo/components/DropDownList

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/FTETextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/TextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1288012 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/utils/TextUtil.as
+++ frameworks/projects/spark/src/spark/utils/TextUtil.as
@@ -21,19 +21,11 @@
 import flash.text.engine.TextLine;
 import flash.utils.describeType;

-import flashx.textLayout.compose.ISWFContext;
 import flashx.textLayout.elements.FlowLeafElement;
 import flashx.textLayout.elements.ParagraphElement;
 import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.formats.ITextLayoutFormat;
-
-import mx.core.IEmbeddedFontRegistry;
-import mx.core.IFlexModuleFactory;
-import mx.core.IUIComponent;
-import mx.core.Singleton;
-import mx.managers.ISystemManager;
-import mx.styles.IStyleClient;

 import mx.resources.IResourceManager;
 import mx.resources.ResourceManager;
@@ -164,179 +156,6 @@
 	}

-    //--------------------------------------------------------------------------
-    //
-    //  Methods - Font Baseline
-    //
-    //--------------------------------------------------------------------------
-
-    //--------------------------------------------------------------------------
-    //
-    //  Class properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Used in getEmbeddedFontContext().
-     */
-    private static var staticTextFormat:TextFormat;
-
-    //----------------------------------
-    //  embeddedFontRegistry
-    //----------------------------------
-
-    private static var noEmbeddedFonts:Boolean;
-
-    /**
-     *  @private
-     *  Storage for the _embeddedFontRegistry property.
-     *  Note: This gets initialized on first access,
-     *  not when this class is initialized, in order to ensure
-     *  that the Singleton registry has already been initialized.
-     */
-    private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
-
-    /**
-     *  @private
-     *  A reference to the embedded font registry.
-     *  Single registry in the system.
-     *  Used to look up the moduleFactory of a font.
-     */
-    private static function get embeddedFontRegistry():IEmbeddedFontRegistry
-    {
-        if (!_embeddedFontRegistry && !noEmbeddedFonts)
-        {
-            try
-            {
-                _embeddedFontRegistry = IEmbeddedFontRegistry(
-                    Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
-            }
-            catch (e:Error)
-            {
-                noEmbeddedFonts = true;
-            }
-        }
-
-        return _embeddedFontRegistry;
-    }
-
-    /**
-     *  Method to measure baseline position
-     *
-     *  @param client The IStyleClient to use to calculate the baseline.
-     *  @param height Height of client.  Used only for degenerate cases.
-     *  @param moduleFactory The default moduleFactory to use for the font.
-     */
-    public static function calculateFontBaseline(client:IStyleClient, height:Number, moduleFactory:IFlexModuleFactory):Number
-    {
-        var fontDescription:FontDescription = new FontDescription();
-        var embeddedFontContext:IFlexModuleFactory;
-
-        var s:String;
-
-        s = client.getStyle("cffHinting");
-        if (s != null)
-            fontDescription.cffHinting = s;
-
-        s = client.getStyle("fontFamily");
-        if (s != null)
-            fontDescription.fontName = s;
-
-        s = client.getStyle("fontLookup");
-        if (s != null)
-        {
-            // FTE understands only "device" and "embeddedCFF"
-            // for fontLookup. But Flex allows this style to be
-            // set to "auto", in which case we automatically
-            // determine it based on whether the CSS styles
-            // specify an embedded font.
-            if (s == "auto")
-            {
-                embeddedFontContext = getEmbeddedFontContext(client, moduleFactory);
-                s = (embeddedFontContext) ?
-                    FontLookup.EMBEDDED_CFF :
-                    FontLookup.DEVICE;
-            }
-            fontDescription.fontLookup = s;
-        }
-
-        s = client.getStyle("fontStyle");
-        if (s != null)
-            fontDescription.fontPosture = s;
-
-        s = client.getStyle("fontWeight");
-        if (s != null)
-            fontDescription.fontWeight = s;
-
-        var elementFormat:ElementFormat = new ElementFormat();
-        elementFormat.fontDescription = fontDescription;
-        elementFormat.fontSize = client.getStyle("fontSize");
-
-        var textElement:TextElement = new TextElement();
-        textElement.elementFormat = elementFormat;
-        textElement.text = "Wj";
-
-        var textBlock:TextBlock = new TextBlock();
-        textBlock.content = textElement;
-
-        var textLine:TextLine;
-        if (embeddedFontContext)
-        {
-            var swfContext:ISWFContext = ISWFContext(embeddedFontContext);
-            textLine = swfContext.callInContext(
-						textBlock.createTextLine, textBlock,
-						[ null, 1000]);
-        }
-        else
-            textLine = textBlock.createTextLine(null, 1000);
-
-        if (height < 2 + textLine.ascent + 2)
-            return int(height + (textLine.ascent - height) / 2);
-
-        return 2 + textLine.ascent;
-    }
-
-	/**
-	 *  @private
-	 *  Uses the component's CSS styles to determine the module factory
-	 *  that should creates its TextLines.
-	 */
-    private static function getEmbeddedFontContext(client:IStyleClient, moduleFactory:IFlexModuleFactory):IFlexModuleFactory
-	{
-		var fontContext:IFlexModuleFactory;
-
-		var fontLookup:String = client.getStyle("fontLookup");
-		if (fontLookup != FontLookup.DEVICE)
-        {
-			var font:String = client.getStyle("fontFamily");
-			var bold:Boolean = client.getStyle("fontWeight") == "bold";
-			var italic:Boolean = client.getStyle("fontStyle") == "italic";
-
-            var localLookup:ISystemManager;
-            if (moduleFactory != null && moduleFactory is ISystemManager)
-                localLookup = ISystemManager(moduleFactory);
-            else if (client is IUIComponent)
-            {
-                var uic:IUIComponent = IUIComponent(client);
-                if (uic.parent is IUIComponent)
-                    localLookup = IUIComponent(uic.parent).systemManager;
-            }
-
-            fontContext = embeddedFontRegistry.getAssociatedModuleFactory(
-            	font, bold, italic, client, moduleFactory, localLookup, true);
-        }
-
-        if (!fontContext && fontLookup == FontLookup.EMBEDDED_CFF)
-        {
-            // if we couldn't find the font and somebody insists it is
-            // embedded, try the default fontContext
-            fontContext = moduleFactory;
-        }
-
-        return fontContext;
-	}
-
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260310 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/SoundEffect.as
+++ frameworks/projects/framework/src/mx/effects/SoundEffect.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2004-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package mx.effects
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4743
Author:   aharui@adobe.com
Date:     2009-01-29T22:28:50.531343Z

Log Message:
-----------
Bunches of FxButtonBar bugs

Most notable change: Re-factored ButtonBar's topology to look less like a container of Buttons and more like a control with child buttons.  The child buttons no longer actually get focus although they appear to.

QE Notes: None
Doc Notes: None
Bugs: SDK-18305, SDK-18366, SDK-18369, SDK-18374, SDK-18376, SDK-18393, SDK-13592, SDK-18611, SDK-18648
Reviewer: Glenn
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxFocusSkin.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/ISelectableRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxButtonBarSkin.mxml</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1278355 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/ButtonBar.as
+++ frameworks/projects/spark/src/spark/components/ButtonBar.as
@@ -11,6 +11,7 @@

 package mx.components
 {
+import flash.events.IEventDispatcher;
 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
@@ -18,7 +19,9 @@

 import mx.components.baseClasses.FxListBase;
 import mx.core.IFactory;
+import mx.core.ISelectableRenderer;
 import mx.core.IVisualElement;
+import mx.core.mx_internal;
 import mx.events.ItemExistenceChangedEvent;
 import mx.managers.IFocusManagerComponent;

@@ -29,7 +32,7 @@
  *
  *  @includeExample examples/FxButtonBarExample.mxml
  */
-public class FxButtonBar extends FxListBase
+public class FxButtonBar extends FxListBase implements IFocusManagerComponent
 {
     include "../core/Version.as";

@@ -55,13 +58,24 @@

         //Add a keyDown event listener so we can adjust
         //selection accordingly.
-        addEventListener(KeyboardEvent.KEY_DOWN, buttonBar_keyDownHandler, true);
-
-		// add a focusIn handler to move the focused button to the top layer
-        addEventListener(FocusEvent.FOCUS_IN, buttonBar_focusInHandler);
-
-    }
-
+        addEventListener(KeyboardEvent.KEY_DOWN, buttonBar_keyDownHandler);
+
+		tabChildren = false;
+		tabEnabled = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Index of currently focused child.
+     */
+    private var focusedIndex:int = 0;
+
     //--------------------------------------------------------------------------
     //
     //  Properties
@@ -107,7 +121,82 @@
     //  Overridden Methods
     //
     //--------------------------------------------------------------------------
-
+
+	private var requiresSelectionChanging:Boolean;
+
+    /**
+     *  @private
+     */
+    override public function set requiresSelection(value:Boolean):void
+	{
+		super.requiresSelection = value;
+		requiresSelectionChanging = true;
+	}
+
+	private var enabledChanging:Boolean;
+
+    /**
+     *  @private
+     */
+    override public function set enabled(value:Boolean):void
+	{
+		super.enabled = value;
+		enabledChanging = true;
+	}
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+		super.commitProperties();
+
+        if (requiresSelectionChanging)
+		{
+			requiresSelectionChanging = false;
+			var n:int = dataProvider.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				var renderer:ISelectableRenderer =
+					dataGroup.getRendererForItemAt(i) as ISelectableRenderer;
+				if (renderer)
+					renderer.allowDeselection = !requiresSelection;
+			}
+		}
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(w:Number, h:Number):void
+    {
+		super.updateDisplayList(w, h);
+
+        if (enabledChanging)
+		{
+			enabledChanging = false;
+			if (dataProvider)
+			{
+				var n:int = dataProvider.length;
+				for (var i:int = 0; i < n; i++)
+				{
+					var renderer:ISelectableRenderer =
+						dataGroup.getRendererForItemAt(i) as ISelectableRenderer;
+					if (renderer)
+						renderer.enabled = enabled;
+				}
+			}
+		}
+    }
+
+    /**
+     *  @private
+     */
+    override public function drawFocus(isFocused:Boolean):void
+    {
+        drawButtonFocus(focusedIndex, isFocused);
+    }
+
     /**
      *  @private
      */
@@ -115,12 +204,12 @@
     {
         super.itemSelected(index, selected);

-        var renderer:Object = dataGroup.getRendererForItemAt(index);
+        var renderer:ISelectableRenderer =
+			dataGroup.getRendererForItemAt(index) as ISelectableRenderer;

         if (renderer)
         {
-            if ("selected" in renderer)
-                renderer.selected = selected;
+            renderer.selected = selected;
         }
     }

@@ -193,11 +282,20 @@
      */
     private function dataGroup_itemAddHandler(event:ItemExistenceChangedEvent):void
     {
-        var renderer:Object = event.renderer;
+        var renderer:IEventDispatcher = IEventDispatcher(event.renderer);
         var index:int = event.index;

         if (renderer)
+		{
             renderer.addEventListener("click", item_clickHandler);
+			if (renderer is IFocusManagerComponent)
+				IFocusManagerComponent(renderer).focusEnabled = false;
+			if (renderer is ISelectableRenderer)
+			{
+				ISelectableRenderer(renderer).allowDeselection = !requiresSelection;
+				ISelectableRenderer(renderer).enabled = enabled;
+			}
+		}

         if (isItemIndexSelected(index))
             itemSelected(index, true);
@@ -223,8 +321,16 @@
     {
         var index:int = dataGroup.getItemIndexForRenderer(
                             event.currentTarget as IVisualElement);
-
-		selectedIndex = index;
+
+		if (index == selectedIndex)
+		{
+			if (!requiresSelection)
+				selectedIndex = -1;
+		}
+		else
+		{
+			focusedIndex = selectedIndex = index;
+		}
     }

     /**
@@ -232,25 +338,16 @@
 	 *  Attempt to lift the focused button above the others
 	 *  so that the focus ring can show.
      */
-    private function buttonBar_focusInHandler(event:FocusEvent):void
-    {
-		var currentButton:IFocusManagerComponent;
-		var index:int;
-		var renderer:Object;
-
-		currentButton = focusManager.getFocus();
-		index = dataGroup.getItemIndexForRenderer(
-		              currentButton as IVisualElement);
-
+    private function adjustLayering(focusedIndex:int):void
+    {
 		var n:int = dataProvider.length;
-		var zz:int = 0;
 		for (var i:int = 0; i < n; i++)
 		{
-			renderer = dataGroup.getRendererForItemAt(i);
-			if (renderer == currentButton)
-				renderer.layer = n - 1;
+			var renderer:IVisualElement = IVisualElement(dataGroup.getRendererForItemAt(i));
+			if (i == focusedIndex)
+				renderer.layer = 1;
 			else
-				renderer.layer = zz++;
+				renderer.layer = 0;
 		}
 	}

@@ -259,23 +356,24 @@
      */
     private function buttonBar_keyDownHandler(event:KeyboardEvent):void
     {
-		var currentButton:IFocusManagerComponent;
-		var index:int;
-		var renderer:Object;
+		var currentRenderer:ISelectableRenderer;
+		var renderer:ISelectableRenderer;

         switch (event.keyCode)
         {
             case Keyboard.UP:
             case Keyboard.LEFT:
             {
-				focusManager.showFocusIndicator = true;
-				currentButton = focusManager.getFocus();
-		        index = dataGroup.getItemIndexForRenderer(
-		                  currentButton as IVisualElement);
-				if (index > 0)
+				currentRenderer = dataGroup.getRendererForItemAt(focusedIndex) as ISelectableRenderer;
+				if (focusedIndex > 0)
 				{
-					renderer = dataGroup.getRendererForItemAt(index-1);
-					IFocusManagerComponent(renderer).setFocus();
+					if (currentRenderer)
+						currentRenderer.showFocusIndicator = false;
+					--focusedIndex;
+					adjustLayering(focusedIndex);
+					renderer = dataGroup.getRendererForItemAt(focusedIndex) as ISelectableRenderer;
+					if (renderer)
+						renderer.showFocusIndicator = true;
 				}

                 break;
@@ -283,20 +381,49 @@
             case Keyboard.DOWN:
             case Keyboard.RIGHT:
             {
-				focusManager.showFocusIndicator = true;
-				currentButton = focusManager.getFocus();
-		        index = dataGroup.getItemIndexForRenderer(
-		                  currentButton as IVisualElement);
-				if (index < dataProvider.length - 1)
+				currentRenderer = dataGroup.getRendererForItemAt(focusedIndex) as ISelectableRenderer;
+				if (focusedIndex < dataProvider.length - 1)
 				{
-					renderer = dataGroup.getRendererForItemAt(index+1);
-					IFocusManagerComponent(renderer).setFocus();
+					if (currentRenderer)
+						currentRenderer.showFocusIndicator = false;
+					++focusedIndex;
+					adjustLayering(focusedIndex);
+					renderer = dataGroup.getRendererForItemAt(focusedIndex) as ISelectableRenderer;
+					if (renderer)
+						renderer.showFocusIndicator = true;
 				}

+                break;
+            }
+            case Keyboard.SPACE:
+            {
+				currentRenderer = dataGroup.getRendererForItemAt(focusedIndex) as ISelectableRenderer;
+				if (!currentRenderer || (currentRenderer.selected && requiresSelection))
+					return;
+				currentRenderer.selected = !currentRenderer.selected;
+				if (currentRenderer.selected)
+					selectedIndex = focusedIndex;
+				else
+					selectedIndex = -1;
+                break;
             }
         }
     }

+    /**
+     *  @private
+     */
+    private function drawButtonFocus(index:int, focused:Boolean):void
+    {
+		var n:int = dataProvider.length;
+        if (n > 0 && index < n)
+        {
+			var renderer:ISelectableRenderer =
+				dataGroup.getRendererForItemAt(index) as ISelectableRenderer;
+			if (renderer)
+				renderer.showFocusIndicator = focused;
+        }
+    }
 }

 }


fixed bug in ColorRamp state verifier

fixed bug in ColorRamp state verifier

--- WeaveJS/src/weavejs/util/ColorRamp.as
+++ WeaveJS/src/weavejs/util/ColorRamp.as
@@ -55,7 +55,7 @@
 				this.setSessionState(array);
 				return false;
 			}
-			return type == String || type == Object;
+			return type == String || type == Object || (state is Array && !state.length);
 		}

 		private var _validateTriggerCount:uint = 0;


FlaLoader: load "MyFla.swf", not "MyFla.fla.swf"

--- exporter/src/main/as/flump/export/FlaLoader.as
+++ exporter/src/main/as/flump/export/FlaLoader.as
@@ -30,7 +30,7 @@
             future.succeed(_library);
         });

-        var loadSWF :Future = _library.loadSWF(file.nativePath + ".swf");
+        var loadSWF :Future = _library.loadSWF(Files.replaceExtension(file, "swf"));
         loadSWF.succeeded.add(function () :void {
             // Since listLibrary shuts down the executor, wait for the swf to load first
             listLibrary(file);


Align downforce to vehicle hull orientation.

--- Bin/Data/Scripts/Vehicle.as
+++ Bin/Data/Scripts/Vehicle.as
@@ -406,6 +406,6 @@

         // Apply downforce proportional to velocity
         Vector3 localVelocity = node.worldRotation.Inverse() * hullBody.linearVelocity;
-        hullBody.ApplyForce(Vector3(0, -1, 0) * Abs(localVelocity.z) * downForce);
-    }
-}
+        hullBody.ApplyForce(node.worldRotation * Vector3(0, -1, 0) * Abs(localVelocity.z) * downForce);
+    }
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1268296 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/Menu.as
+++ frameworks/projects/mx/src/mx/controls/Menu.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2003-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


A typo fixed. Defaulting to "standard" stream type.

git-svn-id: c197267f952b24206666de142881703007ca05d5@11147 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/igniterealtime/xiff/core/XMPPConnection.as
+++ src/org/igniterealtime/xiff/core/XMPPConnection.as
@@ -107,7 +107,7 @@
 		 * Stream type lets user set opening/closing tag.
 		 * <stream:stream />
 		 */
-		public static const STREAM_TYPE_STANDAND_TERMINATED:uint = 1;
+		public static const STREAM_TYPE_STANDARD_TERMINATED:uint = 1;
 		/**
 		 * Stream type lets user set opening/closing tag.
 		 * <flash:stream>
@@ -244,7 +244,7 @@
 		 */
 		protected var _incompleteRawXML:String = "";

-		private var _streamType:uint = 1;
+		private var _streamType:uint = 0;
 		private var presenceQueue:Array = [];
 		private var presenceQueueTimer:Timer;

@@ -274,20 +274,19 @@
 		 * Connects to the server. Use one of the STREAM_TYPE_.. constants.
 		 * Possible options are:
 		 *

+		 *
standard (default)

+		 *
standard terminated

 		 *
flash

-		 *
terminatedFlash

-		 *
standard

-		 *
terminatedStandard (default)

+		 *
flash terminated

 		 *

 		 * Some servers, like Jabber, Inc.'s XCP and Jabberd 1.4 expect <flash:stream> from
 		 * a Flash client instead of the standard <stream:stream>.
 		 *
-		 * @param	streamType (Optional) The type of initial stream negotiation,
-		 * either <flash:stream> or <stream:stream>.
+		 * @param	streamType Any of the STREAM_TYPE_.. constants.
 		 *
 		 * @return A boolean indicating whether the server was found.
 		 */
-		public function connect( streamType:uint = 1 ):Boolean
+		public function connect( streamType:uint = 0 ):Boolean
 		{
 			createSocket();
 			_streamType = streamType;
@@ -508,7 +507,7 @@
 			}
 			openingStreamTag += ' to="' + domain + '" version="' + XMPPStanza.CLIENT_VERSION + '"';

-			if (type == STREAM_TYPE_FLASH_TERMINATED || type == STREAM_TYPE_STANDAND_TERMINATED)
+			if (type == STREAM_TYPE_FLASH_TERMINATED || type == STREAM_TYPE_STANDARD_TERMINATED)
 			{
 				openingStreamTag += ' /';
 			}