Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/components/RadioButtonGroup.as
+++ frameworks/projects/spark/src/spark/components/RadioButtonGroup.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.components
+package spark.components
 {

 import flash.display.DisplayObject;
@@ -32,7 +32,7 @@
 //--------------------------------------

 /**
- *  Dispatched when the value of the selected FxRadioButton control in
+ *  Dispatched when the value of the selected RadioButton control in
  *  this group changes.
  *
  *  @eventType flash.events.Event.CHANGE
@@ -45,8 +45,8 @@
 [Event(name="change", type="flash.events.Event")]

 /**
- *  Dispatched when a user selects a FxRadioButton control in the group.
- *  You can also set a handler for individual FxRadioButton controls.
+ *  Dispatched when a user selects a RadioButton control in the group.
+ *  You can also set a handler for individual RadioButton controls.
  *
  *  This event is dispatched only when the
  *  user interacts with the radio buttons by using the mouse.
@@ -64,22 +64,22 @@
 //  Other metadata
 //--------------------------------------

-[IconFile("FxRadioButtonGroup.png")]
+[IconFile("RadioButtonGroup.png")]

 /**
- *  The FxRadioButtonGroup control defines a group of FxRadioButton controls
+ *  The RadioButtonGroup control defines a group of RadioButton controls
  *  that act as a single mutually exclusive control; therefore,
  *  a user can select only one  control at a time.
  *  The id property is required when you use the
- *  <mx:FxRadioButtonGroup> tag to define the name
+ *  <mx:RadioButtonGroup> tag to define the name
  *  of the group.
  *
- *
Notice that the FxRadioButtonGroup control is a subclass of EventDispatcher,
+ *
Notice that the RadioButtonGroup control is a subclass of EventDispatcher,
  *  not UIComponent, and implements the IMXMLObject interface.
  *  All other Flex visual components are subclasses of UIComponent, which implements
  *  the IUIComponent interface.
- *  The FxRadioButtonGroup control has support built into the Flex compiler
- *  that allows you to use the FxRadioButtonGroup control as a child of a Flex
+ *  The RadioButtonGroup control has support built into the Flex compiler
+ *  that allows you to use the RadioButtonGroup control as a child of a Flex
  *  container, even though it does not implement IUIComponent.
  *  All other container children must implement the IUIComponent interface.

  *
@@ -93,7 +93,7 @@
  *  tag attributes of its superclass, and adds the following tag attributes:

  *
  *

- *  <mx:FxRadioButtonGroup
+ *  <mx:RadioButtonGroup
  *    Properties
  *    enabled="true|false"
  *    id="No default"
@@ -104,14 +104,14 @@
  *  />
  *

  *
- *  @see mx.components.FxRadioButton
+ *  @see mx.components.RadioButton
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxRadioButtonGroup extends EventDispatcher implements IMXMLObject
+public class RadioButtonGroup extends EventDispatcher implements IMXMLObject
 {
     include "../core/Version.as";

@@ -134,7 +134,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxRadioButtonGroup(document:IFlexDisplayObject = null)
+    public function RadioButtonGroup(document:IFlexDisplayObject = null)
     {
         super();
     }
@@ -153,15 +153,15 @@

     /**
      *  @private
-     *  The document containing a reference to this FxRadioButtonGroup.
+     *  The document containing a reference to this RadioButtonGroup.
      */
     private var document:IFlexDisplayObject;

     /**
      *  @private
-     *  An Array of the FxRadioButtons that belong to this group.
-     */
-    private var radioButtons:Array /* of FxRadioButton */ = [];
+     *  An Array of the RadioButtons that belong to this group.
+     */
+    private var radioButtons:Array /* of RadioButton */ = [];

     /**
      *  @private
@@ -185,7 +185,7 @@
     /**
      *  Determines whether selection is allowed.  Note that the value returned
      *  only reflects the value that was explicitly set on the
-     *  FxRadioButtonGroup and does not reflect any values explicitly
+     *  RadioButtonGroup and does not reflect any values explicitly
      *  set on the individual radio buttons.
      *
      *  @default true
@@ -223,7 +223,7 @@
     [Bindable("numRadioButtonsChanged")]

     /**
-     *  The number of FxRadioButtons that belong to this FxRadioButtonGroup.
+     *  The number of RadioButtons that belong to this RadioButtonGroup.
      *
      *  @default "0"
      *
@@ -247,14 +247,14 @@

     /**
      *  The value of the value property of the selected
-     *  FxRadioButton control in the group, if this has been set
+     *  RadioButton control in the group, if this has been set
      *  to be something other than null (the default value).
      *  Otherwise, selectedValue is the value of the
-     *  label property of the selected FxRadioButton.
-     *  If no FxRadioButton is selected, this property is null.
+     *  label property of the selected RadioButton.
+     *  If no RadioButton is selected, this property is null.
      *
      *
If you set selectedValue, Flex selects the
-     *  FxRadioButton control whose value or
+     *  RadioButton control whose value or
      *  label property matches this value.

      *
      *  @default null
@@ -284,7 +284,7 @@
         var n:int = numRadioButtons;
         for (var i:int = 0; i < n; i++)
         {
-            var radioButton:FxRadioButton = getRadioButtonAt(i);
+            var radioButton:RadioButton = getRadioButtonAt(i);
             if (radioButton.value == value ||
                 radioButton.label == value)
             {
@@ -304,7 +304,7 @@
      *  @private
      *  Reference to the selected radio button.
      */
-    private var _selection:FxRadioButton;
+    private var _selection:RadioButton;

     [Bindable("change")]
     [Bindable("valueCommit")]
@@ -312,11 +312,11 @@

     /**
      *  Contains a reference to the currently selected
-     *  FxRadioButton control in the group.
+     *  RadioButton control in the group.
      *  You can access the property in ActionScript only;
      *  it is not settable in MXML.
      *  Setting this property to null deselects the currently
-     *  selected FxRadioButton control.  A change event is not dispatched.
+     *  selected RadioButton control.  A change event is not dispatched.
      *
      *  @default null
      *
@@ -325,7 +325,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function get selection():FxRadioButton
+    public function get selection():RadioButton
     {
         return _selection;
     }
@@ -333,7 +333,7 @@
     /**
      *  @private
      */
-    public function set selection(value:FxRadioButton):void
+    public function set selection(value:RadioButton):void
     {
         if ( _selection == value)
             return;
@@ -375,9 +375,9 @@
      *  Returns the  control at the specified index.
      *
      *  @param index The index of the  control in the
-     *  FxRadioButtonGroup control, where the index of the first control is 0.
-     *
-     *  @return The specified FxRadioButton control if index between
+     *  RadioButtonGroup control, where the index of the first control is 0.
+     *
+     *  @return The specified RadioButton control if index between
      *  0 and numRadioButtons, otherwise null.
      *
      *  @see numRadioButtons
@@ -387,7 +387,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function getRadioButtonAt(index:int):FxRadioButton
+    public function getRadioButtonAt(index:int):RadioButton
     {
         if (index >= 0 && index < numRadioButtons)
             return radioButtons[index];
@@ -410,9 +410,9 @@
     /**
      *  @private
      *  Add a radio button to the group.  This can be called by
-     *  FxRadioButton or via the addedHandler when applying a state.
-     */
-    mx_internal function addInstance(instance:FxRadioButton):void
+     *  RadioButton or via the addedHandler when applying a state.
+     */
+    mx_internal function addInstance(instance:RadioButton):void
     {
         // During a state transition, called when rb is removed from
         // display list.
@@ -439,16 +439,16 @@
     /**
      *  @private
      *  Remove a radio button from the group.  This can be called by
-     *  FxRadioButton or via the removedHandler when removing a state.
-     */
-    private function removeInstance(instance:FxRadioButton):void
+     *  RadioButton or via the removedHandler when removing a state.
+     */
+    private function removeInstance(instance:RadioButton):void
     {
         if (instance)
         {
             var foundInstance:Boolean = false;
             for (var i:int = 0; i < numRadioButtons; i++)
             {
-                var rb:FxRadioButton = getRadioButtonAt(i);
+                var rb:RadioButton = getRadioButtonAt(i);

                 if (foundInstance)
                 {
@@ -492,7 +492,7 @@
     /**
      *  @private
      */
-    mx_internal function setSelection(value:FxRadioButton, fireChange:Boolean = true):void
+    mx_internal function setSelection(value:RadioButton, fireChange:Boolean = true):void
     {
         if (_selection == value)
             return;
@@ -525,7 +525,7 @@
      */
     private function changeSelection(index:int, fireChange:Boolean = true):void
     {
-        var rb:FxRadioButton = getRadioButtonAt(index);
+        var rb:RadioButton = getRadioButtonAt(index);
         if (rb && rb != _selection)
         {
             // Unselect the currently selected radio
@@ -545,13 +545,13 @@

     /**
      *  @private
-     *  Sandbox root of FxRadioButton "a" in breadthOrderCompare().
+     *  Sandbox root of RadioButton "a" in breadthOrderCompare().
      */
     private var aSbRoot:DisplayObject;

     /**
      *  @private
-     *  Sandbox root of FxRadioButton "b" in breadthOrderCompare().
+     *  Sandbox root of RadioButton "b" in breadthOrderCompare().
      */
     private var bSbRoot:DisplayObject;

@@ -570,13 +570,13 @@

         // Only set when a is the radio button.  The sandbox root should be the
         // same for the parents.
-        if (a is FxRadioButton)
-            aSbRoot = FxRadioButton(a).systemManager.getSandboxRoot();
+        if (a is RadioButton)
+            aSbRoot = RadioButton(a).systemManager.getSandboxRoot();

         // Only set when b is the radio button.  The sandbox root should be the
         // same for the parents.
-        if (b is FxRadioButton)
-            bSbRoot = FxRadioButton(b).systemManager.getSandboxRoot();
+        if (b is RadioButton)
+            bSbRoot = RadioButton(b).systemManager.getSandboxRoot();

         // If reached the sandbox root of either then done.
         if (aParent == aSbRoot || bParent == bSbRoot)
@@ -614,7 +614,7 @@
      */
     private function radioButton_addedHandler(event:Event):void
     {
-        var rb:FxRadioButton = event.target as FxRadioButton;
+        var rb:RadioButton = event.target as RadioButton;
         if (rb)
         {
             //trace("radioButton_addedHandler", rb.id);
@@ -628,7 +628,7 @@
      */
     private function radioButton_removedHandler(event:Event):void
     {
-        var rb:FxRadioButton = event.target as FxRadioButton;
+        var rb:RadioButton = event.target as RadioButton;
         if (rb)
         {
             //trace("radioButton_removedHandler", rb.id);


Transferred from the Adobe Open Source Subversion Repository

Revision: 7217
Author:   cframpto@adobe.com
Date:     2009-05-22T14:25:08.370939Z

Log Message:
-----------
Add event for StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED so that we know when a graphic has finished loading and it's size is available.  This requires another measure, if autoSizing, and another pass thru updateDisplayList.

QA Notes:
Doc Notes:
Bugs: SDK-19389 (although the infinite loop with the scroll bars is very evident with this test case)
Reviewers: Gordon

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -43,6 +43,7 @@
 import flashx.textLayout.edit.TextScrap;
 import flashx.textLayout.elements.Configuration;
 import flashx.textLayout.elements.FlowElement;
+import flashx.textLayout.elements.InlineGraphicElementStatus;
 import flashx.textLayout.elements.ParagraphElement;
 import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
@@ -50,6 +51,7 @@
 import flashx.textLayout.events.DamageEvent;
 import flashx.textLayout.events.FlowOperationEvent;
 import flashx.textLayout.events.SelectionEvent;
+import flashx.textLayout.events.StatusChangeEvent;
 import flashx.textLayout.formats.Category;
 import flashx.textLayout.formats.FormatValue;
 import flashx.textLayout.formats.ITextLayoutFormat;
@@ -401,6 +403,10 @@
         _inputManager.addEventListener(
             FlowOperationEvent.FLOW_OPERATION_END,
             inputManager_flowOperationEndHandler);
+
+        _inputManager.addEventListener(
+            StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGED,
+            inputManager_inlineGraphicStatusChangedHandlder);
     }

     //--------------------------------------------------------------------------
@@ -3220,7 +3226,28 @@

         textFlowChanged = false;
     }
-
+
+    /**
+     *  @private
+     *  Called when a InlineGraphicElement is resized due to having width or
+     *  height as auto or percent and the graphic has finished loading.  The
+     *  size of the graphic is now known.
+     */
+    private function inputManager_inlineGraphicStatusChangedHandlder (
+                        event:StatusChangeEvent):void
+    {
+        //trace("inlineGraphicStatusChangedHandlder", event.status);
+
+        // Now that the actual size of the graphic is availabe need to
+        // optionally remeasure and updateContainer.
+        if (InlineGraphicElementStatus.READY)
+        {
+            if (actuallyAutoSizing)
+                invalidateSize();
+
+            invalidateDisplayList();
+        }
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 2805
Author:   chaase@adobe.com
Date:     2008-08-11T20:37:18.700675Z

Log Message:
-----------
First checkin for the "Arbitrary Type Interpolation" feature. This feature has a rewritten Tween class (now named flex.effects.Animation). This class supports the old Tween capabilities, but adds functionality such as the ability to supply alternate interpolation objects (to allow animation of non-Number types), a new Easing API, and new 'repeat behavior' that will allow terser looping or reversing animations. The existing new effects were slightly changed to use the new Animation class (instead of Tween), and the superclass of the new effects, AnimateProperties (renamed 'Animate'), is now a subclass of Effect (not TweenEffect).

Added various new interpolation and easing classes, along with the new packages flex.effects.interpolation and flex.effects.easing. Also added new color-interpolation effect, 'Tint'.

Expect slight tweaks to the API during i7, but the bulk of the functionality and API changes are being checked in now.

Reviewed by Jason S.
Testing: checkintests & mustella tests/Effects (passed)

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animation.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/.actionScriptProperties</path>
<path kind="file" action="A">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/EffectsProperties.mxml</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimatePropertiesInstance.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/AnimateProperties.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/gumbo-manifest.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/components/AnimationPropertiesForm.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Fade.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Constant.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Power.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/ColorInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/AnimateInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/TintInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/IEaser.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Tint.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Animate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/NumberArrayInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/IInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/NumberInterpolator.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/IAnimationTarget.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Resize.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/effectClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/Move.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/effects/interpolation/ArrayInterpolator.as</path>

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

--- frameworks/projects/spark/src/spark/effects/animation/Animation.as
+++ frameworks/projects/spark/src/spark/effects/animation/Animation.as
@@ -0,0 +1,863 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 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 flex.effects
+{
+import flash.events.EventDispatcher;
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+import flash.utils.getTimer;
+
+import flex.effects.easing.Classic;
+import flex.effects.easing.IEaser;
+import flex.effects.easing.Linear;
+import flex.effects.easing.Sine;
+import flex.effects.interpolation.ArrayInterpolator;
+import flex.effects.interpolation.IInterpolator;
+import flex.effects.interpolation.NumberArrayInterpolator;
+import flex.effects.interpolation.NumberInterpolator;
+import flex.events.AnimationEvent;
+
+/**
+ * The Animation class defines an animation that happens between
+ * start and end values over a specified period of time.
+ * The animation can be a change in position, such as performed by
+ * the Move effect; a change in size, as performed by the Resize effect;
+ * a change in visibility, as performed by the Fade effect; or other
+ * types of animations used by effects or run directly with Animation.
+ * This class defines the timing and value parts of the animation; other
+ * code, either in effects or in application code, associate the animation
+ * with objects and properties, such that the animated values produced by
+ * Animation can then be applied to target objects and properties to actually
+ * cause these objects to animate.
+ *
+ *
When defining animation effects, developers typically create an
+ * instance of the Animate class, or some subclass thereof, which creates
+ * an Animation in the play() method. The Animation instance
+ * accepts start and end values, a duration, and optional parameters such as
+ * easer and interpolator objects.

+ *
+ *
The Animation object calls listeners and the start and end of the animation,
+ * as well as when the animation repeats and at regular update intervals during
+ * the animation. These calls pass values which Animation calculated from
+ * the start and end values and the easer and interpolator objects. These
+ * values can then be used to set property values on target obects.
+ *
+ *  @see flex.effects.Animate
+ *  @see flex.effects.effectClasses.AnimateInstance
+ */
+public class Animation extends EventDispatcher
+{
+    /**
+     * TODOs:
+     * - seek? reverse?
+     */
+
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs an Animation object.
+     *
+     * @param startValue The initial value that the animation starts at
+     * @param endValue The final value that the animation ends on
+     * @param duration The length of time, in milliseconds, that the animation
+     * will run
+     * @param IAnimationTarget IAnimationTarget object that will be sent all start,
+     * repeat, update, and end messages.
+     */
+    public function Animation(startValue:Object=null, endValue:Object=null,
+                                  duration:Number=-1, target:IAnimationTarget=null)
+    {
+        this.duration = duration;
+        this.startValue = startValue;
+        this.endValue = endValue;
+        if (target)
+            animationTargets[0] = target;
+        if (!isNaN(duration) && duration != -1)
+            this.duration = duration;
+        if (startValue is Array)
+            arrayMode = true;
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class variables
+    //
+    //--------------------------------------------------------------------------
+
+    public static const LOOP:String = "loop";
+    public static const REVERSE:String = "reverse";
+
+    // A single Timer object runs all animations in the process
+    private static var activeAnimations:Array = [];
+    private static var timer:Timer = null;
+    private static var minRequestedResolution:Number;
+
+    private var arrayMode:Boolean;
+    // TODO: more efficient way to store/remove these than in an array?
+    // Dictionary, perhaps (although that may be unordered and less
+    // efficient to access)
+    private var id:int;
+    // TODO: re-think this variable in seeking
+    private var _doSeek:Boolean = false;
+    private var _isPlaying:Boolean = true;
+    // TODO: rethink how we do reversing
+    private var _doReverse:Boolean = false;
+    private var _invertValues:Boolean = false;
+    // Track when the current cycle started to compute elapsedTime
+    // and current fraction
+    private var startTime:Number;
+    // Track number of times repeated for use by repeatCount logic
+    private var numRepeats:Number;
+
+    // List of objects that will be called with all animation events
+    private var animationTargets:Array = new Array();
+    private var easingFunction:Function;
+    private var defaultEaser:IEaser = new Sine(.5);
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The value that the animation will produce at the beginning of the
+     * animation. Values during the animation are calculated using the
+     * startValue and endValue. This value
+     * can be any arbitray object, but this type must be the same as
+     * that for endValue, and types that are not Number
+     * or Arrays of Number can only be handled if an interpolator
+     * is supplied to the Animation to handle calculating intermediate
+     * values.
+     *
+     * @see interpolator
+     */
+    public var startValue:Object;
+
+    /**
+     * The value that the animation will produce at the beginning of the
+     * animation. Values during the animation are calculated using the
+     * startValue and endValue. This value
+     * can be any arbitray object, but this type must be the same as
+     * that for endValue, and types that are not Number
+     * or Arrays of Number can only be handled if an interpolator
+     * is supplied to the Animation to handle calculating intermediate
+     * values.
+     *
+     * @see interpolator
+     */
+    public var endValue:Object;
+
+    /**
+     * The length of time, in milliseconds, that this animation will run,
+     * not counting any repetitions by use of repeatCount.
+     */
+    public var duration:Number;
+
+    //----------------------------------
+    //  repeatBehavior
+    //----------------------------------
+    /**
+     * @private
+     * Storage for the repeatDelay property.
+     */
+    private var _repeatBehavior:String = LOOP;
+    /**
+     * Sets the behavior of a repeating animation (an animation
+     * with repeatCount equal to either 0 or >1). This
+     * value should be either LOOP, where the animation
+     * will repeat in the same order each time, or REVERSE,
+     * where the animation will reverse direction each iteration.
+     *
+     * @param value A String describing the behavior, either
+     * Animation.LOOP or Animation.REVERSE
+     *
+     * @default LOOP
+     */
+    public function get repeatBehavior():String
+    {
+        return _repeatBehavior;
+    }
+    public function set repeatBehavior(value:String):void
+    {
+        _repeatBehavior = value;
+    }
+
+    //----------------------------------
+    //  repeatCount
+    //----------------------------------
+
+    /**
+     * @private
+     * Storage for the repeatCount property.
+     */
+    private var _repeatCount:Number = 1;
+    /**
+     * Number of times that this animation will repeat. A value of
+     * 0 means that it will repeat indefinitely. Only integer values are
+     * supported, with fractional values rounded up to the next higher integer.
+     *
+     * @param value Number of repetitions for this animation, with 0 being
+     * an infinitely repeating animation. This value must be a positive
+     * number.
+     *
+     * @default 1
+     */
+    public function set repeatCount(value:Number):void
+    {
+        _repeatCount = value;
+    }
+    public function get repeatCount():Number
+    {
+        return _repeatCount;
+    }
+
+    //----------------------------------
+    //  repeatDelay
+    //----------------------------------
+
+    /**
+     * @private
+     * Storage for the repeatDelay property.
+     */
+    private var _repeatDelay:Number = 0;
+    /**
+     * The amount of time spent waiting before each repetition cycle
+     * begins. Setting this value to a non-zero number will have the
+     * side effect that the previous animation cycle will end exactly at
+     * its end value, whereas non-delayed repetitions may skip over that
+     * value completely as the animation transitions smoothly from being
+     * near the end of one cycle to being past the beginning of the next.
+     *
+     * @param value Amount of time, in milliseconds, to wait before beginning
+     * each new cycle. This parameter is used starting with the first repetition,
+     * not the first cycle. For a delay before the initial start, use
+     * the startDelay property. Must be a value >= 0.
+     * @see startDelay
+     *
+     * @default 0
+     */
+    public function set repeatDelay(value:Number):void
+    {
+        _repeatDelay = value;
+    }
+    public function get repeatDelay():Number
+    {
+        return _repeatDelay;
+    }
+
+    /**
+     * @private
+     * Storage for the startDelay property.
+     */
+    private var _startDelay:Number;
+    /**
+     * The amount of time spent waiting before the animation
+     * begins.
+     *
+     * @param value Amount of time, in milliseconds, to wait before beginning
+     * the animation. Must be a value >= 0.
+     */
+    public function set startDelay(value:Number):void
+    {
+        _startDelay = value;
+    }
+    public function get startDelay():Number
+    {
+        return _startDelay;
+    }
+
+    //----------------------------------
+    //  intervalTime
+    //----------------------------------
+
+    /**
+     * @private
+     * Storage for the repeatDelay property.
+     */
+    private static var _intervalTime:Number = NaN;
+    /**
+     * The time being used in the current frame calculations. This time is
+     * shared by all active animations.
+     */
+    public static function get intervalTime():Number
+    {
+        return _intervalTime;
+    }
+
+    //----------------------------------
+    //  interpolator
+    //----------------------------------
+
+    /**
+     * The interpolator used by Animation to calculate values between
+     * the start and end values. By default, interpolation is handled
+     * by NumberInterpolator or, in the case of the start
+     * and end values being arrays, by NumberArrayInterpolator.
+     * Interpolation of other types, or of Numbers that should be interpolated
+     * differently, such as uint values that hold color
+     * channel information, can be handled by supplying a different
+     * interpolator.
+     */
+    public var interpolator:IInterpolator = null;
+
+    //----------------------------------
+    //  resolution
+    //----------------------------------
+
+    /**
+     * @private
+     * Storage for the resolution property. This variable is static
+     * because all animations in the system share the same Timer, which
+     * uses this single resolution.
+     */
+    private static var _resolution:Number = 10;
+    /**
+     * The maximum time between timing events, in milliseconds. It is
+     * possible that the underlying timing mechanism may not be able to
+     * achieve the rate requested by resolution. Since
+     * all Animation objects run off the same underlying timer,
+     * they will all be serviced with the lowest resolution
+     * requested.
+     *
+     * @default 10
+     */
+    public function get resolution():Number
+    {
+        return _resolution;
+    }
+    public function set resolution(value:Number):void
+    {
+        if (isNaN(minRequestedResolution) || value < minRequestedResolution)
+        {
+            _resolution = value;
+            if (timer)
+                timer.delay = _resolution;
+            minRequestedResolution = value;
+        }
+    }
+
+    //----------------------------------
+    //  elapsedTime
+    //----------------------------------
+
+    private var _elapsedTime:Number = 0;
+    /**
+     *  @private
+     *  The current millisecond position in the animation.
+     *  This value is between 0 and duration.
+     *  Use the seek() method to change the position of the animation.
+     */
+    public function get elapsedTime():Number
+    {
+        return _elapsedTime;
+    }
+
+    //----------------------------------
+    //  easer
+    //----------------------------------
+
+    /**
+     * @private
+     * Storage for the easer property.
+     */
+    private var _easer:IEaser;
+    /**
+     * Sets the easing behavior for this Animation. This IEaser
+     * object will be used to convert the elapsed fraction of
+     * the animation into an eased fraction, which will then be used to
+     * calculate the value at that fraction.
+     *
+     * @param value The IEaser object which will be used to calculate the
+     * eased elapsed fraction every time a animation event occurs. A value
+     * of null will be interpreted as meaning no easing is
+     * desired, which is equivalent to using a Linear ease, or
+     * animation.easer = Linear.getInstance();.
+     *
+     * @default Sine(.5)
+     */
+    public function get easer():IEaser
+    {
+        return _easer;
+    }
+    public function set easer(value:IEaser):void
+    {
+        if (!value)
+        {
+            easer = Linear.getInstance();
+        }
+        _easer = value;
+    }
+
+    // TODO: rethink reversal
+    public function get playReversed():Boolean
+    {
+        return _invertValues;
+    }
+    public function set playReversed(value:Boolean):void
+    {
+        _invertValues = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a new animation to the system. All animations run off the same
+     * single Timer, so starting any one animation simply adds it onto the
+     * static list of active animations.
+     */
+    private static function addAnimation(animation:Animation):void
+    {
+        animation.id = activeAnimations.length;
+
+        activeAnimations.push(animation);
+
+        if (!timer)
+        {
+            timer = new Timer(_resolution);
+            timer.addEventListener(TimerEvent.TIMER, timerHandler);
+            timer.start();
+        }
+        else
+        {
+            timer.start();
+        }
+
+        if (isNaN(intervalTime))
+            _intervalTime = getTimer();
+
+        animation.startTime = _intervalTime;
+    }
+
+    private static function removeAnimationAt(index:int):void
+    {
+        if (index >= activeAnimations.length || index < 0)
+            return;
+
+        activeAnimations.splice(index, 1);
+
+        var n:int = activeAnimations.length;
+        for (var i:int = index; i < n; i++)
+        {
+            var curAnimation:Animation = Animation(activeAnimations[i]);
+            curAnimation.id--;
+        }
+
+        if (n == 0)
+        {
+            _intervalTime = NaN;
+            timer.reset();
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private static function removeAnimation(animation:Animation):void
+    {
+        removeAnimationAt(animation.id);
+    }
+
+    private static function timerHandler(event:TimerEvent):void
+    {
+        var oldTime:Number = intervalTime;
+        _intervalTime = getTimer();
+
+        var n:int = activeAnimations.length;
+
+        for (var i:int = n; i >= 0; i--)
+        {
+            var animation:Animation = Animation(activeAnimations[i]);
+            if (animation)
+                animation.doInterval();
+        }
+
+        event.updateAfterEvent();
+    }
+
+    /**
+     * @private
+     *
+     * Calculates the time and elapsed fraction, then gets the
+     * appropriate interpolated value at that fraction, then sends out
+     * the animation event to all listeners.
+     *
+     * Returns true if the animation has ended.
+     */
+    private function doInterval():Boolean
+    {
+        var animationEnded:Boolean = false;
+        var repeated:Boolean = false;
+
+        if (_isPlaying || _doSeek)
+        {
+
+            var currentTime:Number = intervalTime - startTime;
+            if (currentTime >= duration &&
+                (repeatCount == 0 || numRepeats < repeatCount))
+            {
+                // TODO (chaase): this assumes we've only gone through one cycle since
+                // last time...
+                if (repeatCount != 0)
+                    numRepeats++;
+                if (repeatDelay == 0) {
+                    startTime += duration;
+                    currentTime = intervalTime - startTime;
+                    if (repeatBehavior == REVERSE)
+                        _invertValues = !_invertValues;
+                    repeated = true;
+                }
+                else
+                {
+                    // repeatDelay: send out a final update for this cycle with the
+                    // end value, then schedule a timer to wake up and
+                    // start the next cycle
+                    _elapsedTime = duration;
+                    var repeatValue:Object = getCurrentValue(_elapsedTime);
+                    for each (var animationTarget:IAnimationTarget in animationTargets)
+                    {
+                        animationTarget.animationUpdate(this, repeatValue);
+                    }
+                    sendAnimationEvent(AnimationEvent.ANIMATION_UPDATE, repeatValue);
+                    removeAnimation(this);
+                    var delayTimer:Timer = new Timer(repeatDelay, 1);
+                    delayTimer.addEventListener(TimerEvent.TIMER, repeat);
+                    delayTimer.start();
+                    return false;
+                }
+            }
+            _elapsedTime = currentTime;
+
+            var currentValue:Object = getCurrentValue(currentTime);
+
+            if (currentTime >= duration && !_doSeek)
+            {
+                end();
+                animationEnded = true;
+            }
+            else
+            {
+                for each (var target:IAnimationTarget in animationTargets)
+                {
+                    target.animationUpdate(this, currentValue);
+                }
+                sendAnimationEvent(AnimationEvent.ANIMATION_UPDATE, currentValue);
+                if (repeated)
+                    sendAnimationEvent(AnimationEvent.ANIMATION_REPEAT, currentValue);
+            }
+
+            _doSeek = false;
+        }
+        return animationEnded;
+    }
+
+    /**
+     * Utility function for dispatching a specified AnimationEvent.
+     */
+    private function sendAnimationEvent(eventType:String, value:Object):void
+    {
+        var event:AnimationEvent = new AnimationEvent(eventType);
+        event.value = value;
+        event.animation = this;
+        dispatchEvent(event);
+    }
+
+    /**
+     * @private
+     *
+     * Calculates and returns the appropriate value give the elapsed time
+     * of the animation
+     */
+    private function getCurrentValue(currentTime:Number):Object
+    {
+        if (duration == 0)
+        {
+            return endValue;
+        }
+
+        if (_invertValues)
+            currentTime = duration - currentTime;
+
+        var elapsedFraction:Number = easer.ease(currentTime/duration);
+
+        return interpolator.interpolate(elapsedFraction, startValue, endValue);
+    }
+
+    /**
+     *  Interrupt the animation, jump immediately to the end of the animation,
+     *  and send out ending notifications
+     */
+    public function end():void
+    {
+        // TODO (chaase): Check whether we already send out a final
+        // UPDATE event with the end value; if so, this dup should be
+        // removed
+        var value:Object = getCurrentValue(duration);
+
+        sendAnimationEvent(AnimationEvent.ANIMATION_UPDATE, value);
+        sendAnimationEvent(AnimationEvent.ANIMATION_END, value);
+
+        for each (var animationTarget:IAnimationTarget in animationTargets)
+        {
+            animationTarget.animationEnd(this, value);
+        }
+
+        // If animation has been added, id >= 0
+        // but if duration = 0, this might not be the case.
+        if (id >= 0)
+            Animation.removeAnimationAt(id);
+    }
+
+    /**
+     * Start the animation
+     */
+    public function play():void
+    {
+        if (startDelay > 0)
+        {
+            var delayTimer:Timer = new Timer(startDelay, 1);
+            delayTimer.addEventListener(TimerEvent.TIMER, start);
+            delayTimer.start();
+        }
+        else
+        {
+            start();
+        }
+    }
+
+    /**
+     *  Advances the animation effect to the specified position.
+     *
+     *  @param playheadTime The position, in milliseconds, between 0
+     *  and the value of the duration property.
+     */
+    public function seek(playheadTime:Number):void
+    {
+        // Set value between 0 and duration
+        //playheadTime = Math.min(Math.max(playheadTime, 0), duration);
+
+        var clockTime:Number = intervalTime;
+
+        // Reset the start time
+        startTime = clockTime - playheadTime;
+
+        _doSeek = true;
+    }
+
+    /**
+     * Add another listener for all animation events
+     */
+    public function addAnimationTarget(value:IAnimationTarget):void
+    {
+        if (value != null)
+            animationTargets.push(value);
+    }
+
+    /**
+     * @private
+     *
+     * Utility method for setting up easing for this Animation. If
+     * no easing is set, or the easer variable is null,
+     * easing will default to the private defaultEasier
+     * value.
+     */
+    private function setupEasing():void
+    {
+        if (!easer)
+            easer = defaultEaser;
+    }
+
+    /**
+     * Sets up interpolation for the animation. If there is no interpolator
+     * set on the animation, then it figures out whether it should use
+     * NumberInterpolator or NumberArrayInterpolator, based on whether the
+     * start/end values are arrays or not. Also, if the start/end values
+     * are arrays but the supplied interpolator does not interpolate
+     * Arrays, then it sets up an ArrayInterpolator that uses the supplied
+     * interpolator for each element.
+     */
+    private function setupInterpolation():void
+    {
+        if (!interpolator) {
+            if (startValue is Number && endValue is Number)
+                // Better: default to use actual start/end values instead
+                // of running an Interpolator on our internal Animation's result
+                interpolator = NumberInterpolator.getInstance();
+            else if (startValue is Array && endValue is Array)
+            {
+                // One more try - are they Arrays of Numbers?
+                var startArray:Array = startValue as Array;
+                var endArray:Array = endValue as Array;
+                for (var i:int = 0; i < startArray.length; ++i)
+                {
+                    if (isNaN(startArray[i]))
+                    {
+                        throw new Error("startValue array contains non-Numbers: " +
+                                        "must supply Interpolator to Animation");
+                        return;
+                    }
+                }
+                for (i = 0; i < endArray.length; ++i)
+                {
+                    if (isNaN(endArray[i]))
+                    {
+                        throw new Error("endValue array contains non-Numbers: " +
+                                        "must supply Interpolator to Animation");
+                        return;
+                    }
+                }
+                // Must be Arrays of Numbers
+                interpolator = NumberArrayInterpolator.getInstance();
+            }
+        }
+        else
+        {
+            // If they've given us an interpolator, but it doesn't
+            // interpolate arrays and our start/end values are arrays,
+            // then we will assume that they want to use that interpolator
+            // for the elements of the arrays, and we will use
+            // ArrayInterpolator for the overall arrays.
+            if (arrayMode && (interpolator.interpolatedType != Array))
+                interpolator = new ArrayInterpolator(interpolator);
+        }
+    }
+
+    /**
+     *  Plays the effect in reverse,
+     *  starting from the current position of the effect.
+     */
+    public function reverse():void
+    {
+        if (_isPlaying)
+        {
+            _doReverse = false;
+            seek(duration - _elapsedTime);
+            _invertValues = !_invertValues;
+        }
+        else
+        {
+            _doReverse = !_doReverse;
+        }
+    }
+
+    /**
+     * Pauses the effect until the resume() method is called.
+     *
+     * @see resume()
+     */
+    public function pause():void
+    {
+        _isPlaying = false;
+    }
+
+    /**
+     *  Stops the animation, ending it without dispatching an event or calling
+     *  the Animation's end() function.
+     */
+    public function stop():void
+    {
+        if (id >= 0)
+            Animation.removeAnimationAt(id);
+    }
+
+    /**
+     *  Resumes the effect after it has been paused
+     *  by a call to the pause() method.
+     */
+    public function resume():void
+    {
+        _isPlaying = true;
+
+        startTime = intervalTime - _elapsedTime;
+        if (_doReverse)
+        {
+            reverse();
+            _doReverse = false;
+        }
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     *
+     * Called by a Timer after repeatDelay has elapsed for a given
+     * repetition cycle. This causes the animation to send out an initial
+     * value at the starting point, just as if the animation were just starting
+     * out.
+     */
+    private function repeat(event:TimerEvent = null):void
+    {
+        if (repeatBehavior == REVERSE)
+            _invertValues = !_invertValues;
+        var repeatValue:Object = getCurrentValue(0);
+        for each (var animationTarget:IAnimationTarget in animationTargets)
+        {
+            animationTarget.animationRepeat(this, repeatValue);
+        }
+        // TODO (chaase): Make sure we're not already sending out an UPDATE
+        // event with this value
+        sendAnimationEvent(AnimationEvent.ANIMATION_UPDATE, repeatValue);
+        sendAnimationEvent(AnimationEvent.ANIMATION_REPEAT, repeatValue);
+        Animation.addAnimation(this);
+    }
+
+    /**
+     * Called by play() or by a Timer, if startDelay is nonzero. This
+     * method initializes any necessary default state and adds the animation
+     * to the list of active animations, which starts it actually running.
+     */
+    private function start(event:TimerEvent = null):void
+    {
+        numRepeats = 1;
+
+        setupInterpolation();
+        setupEasing();
+
+        if (duration == 0)
+        {
+            id = -1; // use -1 to indicate that this animation was never added
+            end();
+        }
+        else
+        {
+            var value:Object = getCurrentValue(0);
+            for each (var animationTarget:IAnimationTarget in animationTargets)
+            {
+                animationTarget.animationStart(this, value);
+                animationTarget.animationUpdate(this, value);
+            }
+            // TODO (chaase): Make sure we're not already sending out an
+            // UPDATE event with this start value
+            sendAnimationEvent(AnimationEvent.ANIMATION_START, value);
+            sendAnimationEvent(AnimationEvent.ANIMATION_UPDATE, value);
+            Animation.addAnimation(this);
+        }
+    }
+
+}
+}


I'm pretty sure we never read Credentials on the client...

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5909 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/presents/net/Credentials.as
+++ src/as/com/threerings/presents/net/Credentials.as
@@ -43,7 +43,7 @@
     public function readObject (ins :ObjectInputStream) :void
         //throws IOError
     {
-        // nada
+        throw new Error(); // we never read Creds on the client
     }
 }
 }


make sure only the stage gets clicks

make sure only the stage gets clicks

--- src/flash/FlashMediaElement.as
+++ src/flash/FlashMediaElement.as
@@ -591,7 +591,9 @@

 		function stageClicked(e:MouseEvent):void {
 			//_output.appendText("click: " + e.stageX.toString() +","+e.stageY.toString() + "\n");
-			sendEvent("click", "");
+			if (e.target == stage) {
+				sendEvent("click", "");
+			}
 		}

 		function resizeHandler(e:Event):void {


Removed Whitespace

Removed Whitespace

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4480 3e7533ad-8678-4d30-8e38-00a379d3f0d0

--- src/laml/display/IconButton.as
+++ src/laml/display/IconButton.as
@@ -141,7 +141,7 @@

 		protected function validateEmbedFonts(newValue:*, oldValue:*):void {
 			label.embedFonts = newValue;
-		}
+		}

 		protected function get configXml():XML {
 			var xml:XML = <HBox id={ICON_CONTAINER} width="100%" height="100%" xmlns="laml.display">


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

--- frameworks/projects/automation_dmv/src/AutomationDMVClasses.as
+++ frameworks/projects/automation_dmv/src/AutomationDMVClasses.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 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
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 18809
Author:   egeorgie@adobe.com
Date:     2010-11-24T02:39:54.532608Z

Log Message:
-----------
Density Scaling

- Add authorDensity property to the Applicaiton
- Add DensityUtil class and DeviceDensity enum

QE notes:
Doc notes:
Bugs:
Reviewer: Glenn
Tests run: checkintests, cyclone
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/DensityUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreen.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/tools/dependencychecker/frameworkSwcExceptionsList.txt</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DeviceDensity.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/framework/src/mx/managers/SystemManager.as
+++ frameworks/projects/framework/src/mx/managers/SystemManager.as
@@ -61,6 +61,7 @@
 import mx.events.ResizeEvent;
 import mx.events.SandboxMouseEvent;
 import mx.preloaders.Preloader;
+import mx.utils.DensityUtil;
 import mx.utils.LoaderUtil;

 // NOTE: Minimize the non-Flash classes you import here.
@@ -707,6 +708,42 @@
     }

     //----------------------------------
+    //  densityScale
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the densityScale property
+     */
+    private var _densityScale:Number = NaN;
+
+    /**
+     *  The density scale factor of the application.
+     *
+     *  When density scaling is enabled, Flex applies a scale factor based on
+     *  the application author density and the density of the current device
+     *  that Flex is running on.
+     *
+     *  Returns 1.0 when there is no scaling.
+     *
+     *  @see spark.components.Application#authorDensity
+     *  @see mx.core.DensityUtil
+     */
+    public function get densityScale():Number
+    {
+        if (isNaN(_densityScale))
+        {
+            var authorDensity:String = info()["authorDensity"];
+            var deviceDensity:String = DensityUtil.screenDPIToDeviceDensity(flash.system.Capabilities.screenDPI);
+            _densityScale = DensityUtil.getDensityScale(authorDensity, deviceDensity);
+            if (isNaN(_densityScale))
+                _densityScale = 1;
+        }
+
+        return _densityScale;
+    }
+
+    //----------------------------------
     //  document
     //----------------------------------

@@ -1981,6 +2018,11 @@
             Loader(parent).contentLoaderInfo.applicationDomain :
             info()["currentDomain"] as ApplicationDomain;

+        // FIXME (egeorgie): the "screen" that we pass to the preloader
+        // doesn't get the right size here, since stage is not
+        // yet resized at this point if running in AIR on device.
+        // We'll receive a stage resize event before the first enter frame event.
+
         // Initialize the preloader.
         preloader.initialize(
             usePreloader,
@@ -1989,16 +2031,14 @@
             preloaderBackgroundAlpha,
             preloaderBackgroundImage,
             preloaderBackgroundSize,
-            isStageRoot ? stage.stageWidth : loaderInfo.width,
-            isStageRoot ? stage.stageHeight : loaderInfo.height,
+            isStageRoot ? screen.width : loaderInfo.width,
+            isStageRoot ? screen.height : loaderInfo.height,
             null,
             null,
             rslItemList,
             resourceModuleURLs,
             domain);
     }
-
-

     //--------------------------------------------------------------------------
     //
@@ -3108,17 +3148,21 @@
         _screen.width = w;
         _screen.height = h;

+        // FIXME (egeorgie): better handling of screen reesize,
+        // refactor this code?
         if (isStageRoot)
         {
-            //_width = stage.stageWidth;
-            //_height = stage.stageHeight;
-
-            // TODO: Finalize scaling behavior
-            var scale:Number = 1;
-
+            var scale:Number = densityScale;
+
             root.scaleX = root.scaleY = scale;
             _width = stage.stageWidth / scale;
             _height = stage.stageHeight / scale;
+
+            // Update the screen
+            _screen.x /= scale;
+            _screen.y /= scale;
+            _screen.width /= scale;
+            _screen.height /= scale;
         }

         if (event)
@@ -3129,7 +3173,7 @@
             isDispatchingResizeEvent = false;
         }
     }
-
+
     /**
      *  @private
      *


Transferred from the Adobe Open Source Subversion Repository

Revision: 10058
Author:   aharui@adobe.com
Date:     2009-09-08T18:18:22.360040Z

Log Message:
-----------
Fix DataGrid bugs.  dragscrolling was not getting turned off (a potential module leak issue).  IPEs were resetting the cursor when they probably shouldn't.

QE Notes: None
Doc Notes: None
Bugs: SDK-15433. SDK-15026
Reviewer: Corey
API Change: No
Is noteworthy for integration: No
tests: checkintests mustella/managers/DataGrid, List

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase.as</path>

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

--- frameworks/projects/mx/src/mx/controls/listClasses/ListBase.as
+++ frameworks/projects/mx/src/mx/controls/listClasses/ListBase.as
@@ -1798,8 +1798,8 @@
             listItems[listItems.length-1][0].y + rowHeight - oldContentHeight + listContent.topOffset :
             0;

-        if (iteratorValid)
-            iterator.seek(cursorPos, 0);
+        iterator.seek(cursorPos, 0);
+
         // make sure list content is moved to the appropriate place.
         // might be able to optimize and not do this every time
         adjustListContent(unscaledWidth,unscaledHeight);
@@ -4634,9 +4634,10 @@
             }
             catch(e:ItemPendingError)
             {
-                lastSeekPending = new ListBaseSeekPending(CursorBookmark.CURRENT, listItems.length)
-                e.addResponder(new ItemResponder(seekPendingResultHandler, seekPendingFailureHandler,
-                                                lastSeekPending));
+                //AJH commented out to fix one bug.  We'll see if it causes others
+                //lastSeekPending = new ListBaseSeekPending(CursorBookmark.CURRENT, listItems.length)
+                //e.addResponder(new ItemResponder(seekPendingResultHandler, seekPendingFailureHandler,
+                //                                lastSeekPending));
                 // trace("IPE in UpdateDisplayList");
                 iteratorValid = false;
                 // don't do anything, we'll repaint when the data arrives
@@ -10083,7 +10084,7 @@
         systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
         systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseLeaveHandler);

-        if (!dragEnabled && dragScrollingInterval != 0)
+        if (dragScrollingInterval != 0)
         {
             clearInterval(dragScrollingInterval);
             dragScrollingInterval = 0;


add ScriptController.initialize() fix ScriptController.start() that was never actually called

--- src/aerys/minko/scene/controller/ScriptController.as
+++ src/aerys/minko/scene/controller/ScriptController.as
@@ -14,7 +14,6 @@
 		private var _deltaTime		: Number;
 		private var _currentTarget	: ISceneNode;
 		private var _viewport		: Viewport;
-		private var _scene			: Scene;

 		protected function get deltaTime() : Number
 		{
@@ -36,26 +35,16 @@
 			return _viewport;
 		}

-		protected function get scene() : Scene
-		{
-			return _scene;
-		}
-
 		public function ScriptController(targetType	: Class = null)
 		{
 			super(targetType);

-			initialize();
-		}
-
-		private function initialize() : void
-		{
 			var numTargets : uint = this.numTargets;

 			for (var i : uint = 0; i < numTargets; ++i)
-				start(getTarget(i));
+				initialize(getTarget(i));
 		}
-
+
 		override protected function sceneEnterFrameHandler(scene		: Scene,
 														   viewport		: Viewport,
 														   destination	: BitmapData,
@@ -64,13 +53,28 @@
 			_viewport = viewport;
 			_deltaTime = _lastTime - time;
 			_lastTime = time;
-			_scene = scene;

 			var numTargets : uint = this.numTargets;

 			for (var i : uint = 0; i < numTargets; ++i)
-				update(getTarget(i));
+            {
+                var target : ISceneNode = getTarget(i);
+
+                if (target.scene)
+    				update(target);
+            }
 		}
+
+        override protected function targetAddedToSceneHandler(target    : ISceneNode,
+                                                              scene     : Scene) : void
+        {
+            super.targetAddedToSceneHandler(target, scene);
+
+            var numTargets : uint = this.numTargets;
+
+            for (var i : uint = 0; i < numTargets; ++i)
+                start(getTarget(i));
+        }

 		override protected function targetRemovedFromSceneHandler(target	: ISceneNode,
 																  scene		: Scene) : void
@@ -83,6 +87,11 @@
 				stop(getTarget(i));
 		}

+        protected function initialize(target : ISceneNode) : void
+        {
+            // nothing
+        }
+
 		protected function start(target : ISceneNode) : void
 		{
 			// nothing


Use the TextField hack ourselves.
- Flash seems to sketch out when key events go elsewhere
- Whirled now does the handy thing of re-routing 'word' keypresses
  to the ChatControl, unless a TextField has focus. We want to automatically
  let games get any and all keypresses...
- The damn focus stuff is broken anyway

Untested, Nathan will test.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@231 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/ezgame/client/GameContainer.as
+++ src/as/com/threerings/ezgame/client/GameContainer.as
@@ -25,15 +25,13 @@

 import flash.geom.Rectangle;

+import flash.text.TextField;
+
 import mx.core.mx_internal;
 import mx.core.IFlexDisplayObject;
 import mx.core.IInvalidating;

 import mx.containers.VBox;
-
-import mx.managers.IFocusManagerComponent;
-
-import mx.skins.ProgrammaticSkin;

 import com.threerings.flash.MediaContainer;

@@ -45,10 +43,11 @@
 //    damn thing doesn't seem to grip onto the focus.
 //
 public class GameContainer extends VBox
-    implements IFocusManagerComponent
 {
     public function GameContainer (url :String)
     {
+        rawChildren.addChild(_keyGrabber = new TextField());
+        _keyGrabber.selectable = false;
         rawChildren.addChild(_game = new MediaContainer(url));

         tabEnabled = true; // turned off by Container
@@ -58,6 +57,13 @@
     public function getMediaContainer () :MediaContainer
     {
         return _game;
+    }
+
+    override public function setActualSize (w :Number, h :Number) :void
+    {
+        super.setActualSize(w, h);
+        _keyGrabber.width = w;
+        _keyGrabber.height = h;
     }

 //    override public function setFocus () :void
@@ -71,27 +77,29 @@
 //        }
 //    }

-    override protected function adjustFocusRect (obj :DisplayObject = null) :void
-    {
-        super.adjustFocusRect(obj);
-
-        // TODO: this is probably all wrong
-        var focusObj :IFlexDisplayObject =
-            IFlexDisplayObject(mx_internal::getFocusObject());
-        if (focusObj) {
-            var r :Rectangle = transform.pixelBounds;
-            focusObj.setActualSize(r.width - 2, r.height - 2);
-            focusObj.move(0, 0);
-
-            if (focusObj is IInvalidating) {
-                IInvalidating(focusObj).validateNow();
-
-            } else if (focusObj is ProgrammaticSkin) {
-                ProgrammaticSkin(focusObj).validateNow();
-            }
-        }
-    }
+//    override protected function adjustFocusRect (obj :DisplayObject = null) :void
+//    {
+//        super.adjustFocusRect(obj);
+//
+//        // TODO: this is probably all wrong
+//        var focusObj :IFlexDisplayObject =
+//            IFlexDisplayObject(mx_internal::getFocusObject());
+//        if (focusObj) {
+//            var r :Rectangle = transform.pixelBounds;
+//            focusObj.setActualSize(r.width - 2, r.height - 2);
+//            focusObj.move(0, 0);
+//
+//            if (focusObj is IInvalidating) {
+//                IInvalidating(focusObj).validateNow();
+//
+//            } else if (focusObj is ProgrammaticSkin) {
+//                ProgrammaticSkin(focusObj).validateNow();
+//            }
+//        }
+//    }

     protected var _game :MediaContainer;
+
+    protected var _keyGrabber :TextField;
 }
 }


Fix 687045 - Expanded acceptance tests for ByteArray (r=dschaffe)

--- test/acceptance/as3/ShellClasses/ByteArray.as
+++ test/acceptance/as3/ShellClasses/ByteArray.as
@@ -68,6 +68,16 @@
     return bytearray;
 }

+// Utility to test for RangeError
+function expectRangeError(tag, thunk)
+{
+    var exn_ok = "No exn";
+    try                   { thunk(); }
+    catch (e: RangeError) { exn_ok = "OK"; }
+    catch (e)             { exn_ok = "Wrong type"; }
+    AddTestCase(tag, "OK", exn_ok);
+}
+
 // Utility to test for EOFError
 function expectEOF(tag, thunk)
 {
@@ -398,6 +408,21 @@
                           v = bytearray.readInt();
                       }));
         }
+
+        // Testing for wraparound problems when reading with position
+        // much greater than length.  Given that the bytevector size
+        // is 1000, a length of 0xFFFFFFF0 will always wrap around on
+        // a 32-bit system.  On a 64-bit system we depend on the C++
+        // run-time code using uint32_t to represent length and
+        // position; if it did not we might abort due to a too-large
+        // allocation attempt.
+
+        bytearray.length = 1000;
+        expectEOF("ByteArray readInt_3 #2 at position=2^32-16",
+                  (function () {
+                      bytearray.position = 0xFFFFFFF0;
+                      v = bytearray.readInt();
+                    }));
     }

     for ( var offs=0 ; offs < 4 ; offs++ ) {
@@ -769,7 +794,32 @@
                   bytearray.readUTF();
               }));

-    // TODO: test that any UTF8 BOM is being skipped
+    // Doc sez: A RangeError will be thrown for writeUTF if the string length exceeds 65535.
+    expectRangeError("RangeError in writeUTF",
+                     (function () {
+                         var s = "86868686";
+                         while (s.length <= 65535)
+                             s = s + s;
+                         bytearray.writeUTF(s);
+                     }));
+
+    // Skip UTF-8 BOM.
+    // This seems fairly ill-defined and ad-hoc since the BOM is skipped but is accounted for in the byte count,
+    // but it's what we do, so test that we continue to do it...
+    bytearray.length = 0;
+    bytearray.position = 0;
+    bytearray.endian = "bigEndian";
+    bytearray.writeByte(0);
+    bytearray.writeByte(6);
+    bytearray.writeByte(0xEF);
+    bytearray.writeByte(0xBB);
+    bytearray.writeByte(0xBF);
+    bytearray.writeUTFBytes("string");
+    bytearray.position = 0;
+    AddTestCase("ByteArray readUTF skips UTF8 BOM after length bytes but includes it in the length",
+                "str",
+                bytearray.readUTF());
+
     // TODO: test invalid UTF - we should still get data, in a predictable way (invalid input turns into individual bytes)
 }

@@ -821,7 +871,21 @@
                   bytearray.readUTFBytes(6); // one too much
               }));

-    // TODO: test that any UTF8 BOM is being skipped
+    // Skip UTF-8 BOM.
+    // This seems fairly ill-defined and ad-hoc since the BOM is skipped but is accounted for in the byte count,
+    // but it's what we do, so test that we continue to do it...
+    bytearray.length = 0;
+    bytearray.position = 0;
+    bytearray.endian = "bigEndian";
+    bytearray.writeByte(0xEF);
+    bytearray.writeByte(0xBB);
+    bytearray.writeByte(0xBF);
+    bytearray.writeUTFBytes("string");
+    bytearray.position = 0;
+    AddTestCase("ByteArray readUTFBytes skips UTF8 BOM but includes it in the length",
+                "str",
+                bytearray.readUTFBytes(6));
+
     // TODO: test invalid UTF - we should still get data, in a predictable way (invalid input turns into individual bytes)
 }

@@ -839,6 +903,21 @@
     bytearray.uncompress();
     AddTestCase(
         "ByteArray length after uncompress",
+        6,
+        bytearray.length);
+
+    bytearray.length = 0;
+    bytearray.position = 0;
+    bytearray.writeUTFBytes("string");
+    bytearray.deflate();
+    AddTestCase(
+        "ByteArray length after deflate",
+        8,  // This is what the inflate algorithm produces on 2011-09-22, so we accept it as Truth.
+        bytearray.length);
+
+    bytearray.inflate();
+    AddTestCase(
+        "ByteArray length after inflate",
         6,
         bytearray.length);

@@ -1041,6 +1120,13 @@
                   bytearray.readBytes(bytearray3, 0, bytearray.length+1);
               }));

+    // Doc sez: A RangeError will be thrown if the value of offset+length exceeds 2^32-1
+    expectRangeError("RangeError in readBytes",
+                     (function () {
+                         bytearray3.position = 0;
+                         bytearray.readBytes(bytearray3, 0xFFFFFFFF, 1);
+                     }));
+
     // TODO: test more combinations of offset and count
 }

@@ -1128,6 +1214,8 @@

 function testBOM() {
     var bytearray_bom:ByteArray=new ByteArray;
+
+// TODO: toString also skips little-endian and big-endian UTF-16 BOMs (0xFF 0xFE and 0xFE 0xFF).
     bytearray_bom[0]=0xef;
     bytearray_bom[1]=0xbb;
     bytearray_bom[2]=0xbf;


Transferred from the Adobe Open Source Subversion Repository

Revision: 4040
Author:   gosmith@adobe.com
Date:     2008-11-07T02:08:56.069851Z

Log Message:
-----------
Improved text hiliting.

Text selections in TextView now hilite using three CSS-settable colors. And you can control whether the selection is shown when the component doesn't have focus, and when the window isn't active.

The visibility of the selection is determined by a new 'selectionVisibility' property on TextView and FxTextBase. The allowed values -- "whenFocused", "whenActive", and "always" -- are available in the new TextSelectionVisibility enum class. This is similar to TextField's 'alwaysShowSelection' property but more general.

The hilite color in each of the three states is determined by the three styles selectionColor, unfocusedSelectionColor, and inactiveSelectionColor. The latter two are new in Gumbo. Note that the existing selectionColor style now applies to selected text as well as to selected list items, etc. We may decide to have unfocusedSelectionColor and inactiveSelectionColor apply to things like list items as well, but that isn't part of this checkin.

QE Notes: The blinking insertion point is now barely visible because it is the selection hilite color. I'll work with the TLF team to get it drawn in a highly-visible way. Also, the selectionColor is not getting properly computed based on the themeColor for FxApplications.
Doc Notes: None
Bugs: None
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextSelectionVisibility.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/SelectionFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</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/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>

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

--- frameworks/projects/spark/src/spark/styles/metadata/SelectionFormatTextStyles.as
+++ frameworks/projects/spark/src/spark/styles/metadata/SelectionFormatTextStyles.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  Documentation is not currently available.
+ */
+[Style(name="selectionColor", type="uint", format="color", inherit="yes")]
+
+/**
+ *  Documentation is not currently available.
+ */
+[Style(name="inactiveSelectionColor", type="uint", format="color", inherit="yes")]
+
+/**
+ *  Documentation is not currently available.
+ */
+[Style(name="unfocusedSelectionColor", type="uint", format="color", inherit="yes")]


fixed bug in bounds reporting

fixed bug in bounds reporting

Change-Id: Ib19d58222592deee3f752425af753d68605b3d9e

--- WeaveUISpark/src/weave/visualization/plotters/SingleImagePlotter.as
+++ WeaveUISpark/src/weave/visualization/plotters/SingleImagePlotter.as
@@ -116,11 +116,11 @@
 				output.setXRange(x - w, x);

 			if (verticalAlign.value == BitmapText.VERTICAL_ALIGN_TOP)
-				output.setYRange(y, y + h);
+				output.setYRange(y - h, y);
 			if (verticalAlign.value == BitmapText.VERTICAL_ALIGN_MIDDLE)
 				output.setCenteredYRange(y, h);
 			if (verticalAlign.value == BitmapText.VERTICAL_ALIGN_BOTTOM)
-				output.setYRange(y - h, y);
+				output.setYRange(y, y + h);
 		}

 		override public function drawBackground(dataBounds:IBounds2D, screenBounds:IBounds2D, destination:BitmapData):void


Working on ImageTest

Working on ImageTest

--- test/laml/display/ImageTest.as
+++ test/laml/display/ImageTest.as
@@ -1,6 +1,8 @@
 package laml.display {

 	import asunit.framework.TestCase;
+
+	import flash.utils.setTimeout;

 	import laml.events.PayloadEvent;

@@ -39,12 +41,32 @@
 			image.source = sproutsLogo;
 		}

-		public function testUrl():void {
-			var handler:Function = function(event:PayloadEvent):void {
+		public function testSourceChanged():void {
+			image.preferredWidth = 300;
+			image.preferredHeight = 200;
+			image.x = 300;
+			image.y = 20;
+			image.backgroundColor = 0xFFCC00;
+
+			var completed:Function = function(event:PayloadEvent):void {
 				assertEquals(205, image.width);
 				assertEquals(104, image.height);
 			}
-			image.addEventListener(PayloadEvent.LOADING_COMPLETED, addAsync(handler));
+
+			var updateSource:Function = function():void {
+				image.source = imageUrl;
+			}
+
+			image.addEventListener(PayloadEvent.LOADING_COMPLETED, addAsync(completed));
+			setTimeout(updateSource, 100);
+		}
+
+		public function testUrl():void {
+			var completed:Function = function(event:PayloadEvent):void {
+				assertEquals(205, image.width);
+				assertEquals(104, image.height);
+			}
+			image.addEventListener(PayloadEvent.LOADING_COMPLETED, addAsync(completed));
 			image.source = imageUrl;
 		}
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 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 spark.components
 {
 /**