Transferred from the Adobe Open Source Subversion Repository

Revision: 18982
Author:   clucier@adobe.com
Date:     2010-12-02T21:29:40.550335Z

Log Message:
-----------
3D cube flip view transition.

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Chiedo
Tests run: Checkin
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/transitions/ViewTransitionBase.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/FlipViewTransition.as
@@ -11,16 +11,19 @@

 package spark.transitions
 {
-
+
 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.geom.Matrix3D;
 import flash.geom.PerspectiveProjection;
 import flash.geom.Point;

+import mx.core.ILayoutElement;
+import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.effects.IEffect;
+import mx.effects.Parallel;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;

@@ -28,7 +31,7 @@
 import spark.components.TabbedViewNavigator;
 import spark.components.ViewNavigator;
 import spark.components.supportClasses.ButtonBarBase;
-import spark.effects.Animate;
+import spark.effects.*;
 import spark.effects.animation.Keyframe;
 import spark.effects.animation.MotionPath;
 import spark.effects.animation.SimpleMotionPath;
@@ -50,496 +53,720 @@
  */
 public class FlipViewTransition extends ViewTransitionBase
 {
-	//--------------------------------------------------------------------------
-	//
-	//  Constructor
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Constructor.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	public function FlipViewTransition()
-	{
-		super();
-
-		// Defaut duration of 400 yields a smoother result.
-		duration = 400;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Variables
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Property bag used to save any start view properties that
-	 *  are then restored after the transition is complete.
-	 */
-	private var startViewProps:Object = {};
-
-	/**
-	 *  @private
-	 *  Property bag used to save any end view properties that
-	 *  are then restored after the transition is complete.
-	 */
-	private var endViewProps:Object = {};
-
-	/**
-	 *  @private
-	 *  Property bag used to save any navigator centric properties that
-	 *  are then restored after the transition is complete.
-	 */
-	private var navigatorProps:Object = {};
-
-	/**
-	 *  @private
-	 *  Parents our start and end view elements while flipping.
-	 */
-	private var transitionGroup:Group;
-
-	/**
-	 *  @private
-	 *  Flag to denote if we're flipping vertically or horizontally.
-	 */
-	private var vertical:Boolean;
-
-	/**
-	 *  @private
-	 *  Used to save off our pending view's transform matrix while we animate.
-	 */
-	private var savedMatrix:Matrix3D;
-
-	//--------------------------------------------------------------------------
-	//
-	//  Properties
-	//
-	//--------------------------------------------------------------------------
-
-	//---------------------------------
-	// direction
-	//---------------------------------
-
-	private var _direction:String = ViewTransitionDirection.LEFT;
-
-	/**
-	 *  Specifies the direction of flip transition.
-	 *
-	 *  @default ViewTransitionDirection.LEFT
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	public function get direction():String
-	{
-		return _direction;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set direction(value:String):void
-	{
-		_direction = value;
-	}
-
-	//---------------------------------
-	// mode
-	//---------------------------------
-
-	private var _mode:String = FlipViewTransitionMode.CARD;
-
-	/**
-	 *  Specifies the type of flip transition to perform.
-	 *
-	 *  @default FlipViewTransitionMode.CARD
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	public function get mode():String
-	{
-		return _mode;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function set mode(value:String):void
-	{
-		_mode = value;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @inheritDoc
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	override public function captureStartValues():void
-	{
-		super.captureStartValues();
-
-		// Initialize the property bag used to save some of our
-		// properties that are then restored after the transition is over.
-		navigatorProps = new Object();
-
-		// Snapshot the entire navigator.
-		var oldVisibility:Boolean = endView.visible;
-		endView.visible = false;
-		cachedNavigator = getSnapshot(targetNavigator);
-		endView.visible = oldVisibility;
-	}
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function FlipViewTransition()
+    {
+        super();
+
+        // Defaut duration of 450 yields a smoother result.
+        duration = 450;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Property bag used to save any start view properties that
+     *  are then restored after the transition is complete.
+     */
+    private var startViewProps:Object = {};
+
+    /**
+     *  @private
+     *  Property bag used to save any end view properties that
+     *  are then restored after the transition is complete.
+     */
+    private var endViewProps:Object = {};
+
+    /**
+     *  @private
+     *  Property bag used to save any navigator centric properties that
+     *  are then restored after the transition is complete.
+     */
+    private var navigatorProps:Object = {};
+
+    /**
+     *  @private
+     *  Parents our start and end view elements while flipping.
+     */
+    private var transitionGroup:Group;
+
+    /**
+     *  @private
+     *  Flag to denote if we're flipping vertically or horizontally.
+     */
+    private var vertical:Boolean;
+
+    /**
+     *  @private
+     *  Used to save off our pending view's transform matrix while we animate.
+     */
+    private var savedStartMatrix:Matrix3D;
+
+    /**
+     *  @private
+     *  Used to save off our pending view's transform matrix while we animate.
+     */
+    private var savedEndMatrix:Matrix3D;
+
+    /**
+     *  @private
+     */
+    private var viewWidth:Number;
+
+    /**
+     *  @private
+     */
+    private var viewHeight:Number;
+
+    /**
+     *  @private
+     */
+    private var directionModifier:int;
+
+    /**
+     *  @private
+     */
+    private var animatedProperty:String;
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    // direction
+    //---------------------------------
+
+    private var _direction:String = ViewTransitionDirection.LEFT;
+
+    /**
+     *  Specifies the direction of flip transition.
+     *
+     *  @default ViewTransitionDirection.LEFT
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get direction():String
+    {
+        return _direction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set direction(value:String):void
+    {
+        _direction = value;
+    }
+
+    //---------------------------------
+    // mode
+    //---------------------------------
+
+    private var _mode:String = FlipViewTransitionMode.CARD;
+
+    /**
+     *  Specifies the type of flip transition to perform.
+     *
+     *  @default FlipViewTransitionMode.CARD
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get mode():String
+    {
+        return _mode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set mode(value:String):void
+    {
+        _mode = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override public function captureStartValues():void
+    {
+        super.captureStartValues();
+
+        // Initialize the property bag used to save some of our
+        // properties that are then restored after the transition is over.
+        navigatorProps = new Object();
+
+        // Snapshot the entire navigator.
+        var oldVisibility:Boolean = endView.visible;
+        endView.visible = false;
+        cachedNavigator = getSnapshot(targetNavigator);
+        endView.visible = oldVisibility;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override protected function createViewEffect():IEffect
+    {
+        // Don't bother transitioning if we're missing views.
+        if (!startView || !endView)
+            return null;
+
+        return (mode == FlipViewTransitionMode.CARD) ?
+            prepareCardViewEffect() :
+            prepareCubeViewEffect();
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override protected function createConsolidatedEffect():IEffect
+    {
+        // If we have no cachedNavigator then there is not much we can do.
+        if (!cachedNavigator)
+            return null;
+
+        return mode == FlipViewTransitionMode.CARD ?
+            prepareConsolidatedCardViewEffect() :
+            prepareConsolidatedCubeViewEffect();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    override public function prepareForPlay():void
+    {
+        actionBarTransitionDirection = direction;
+        super.prepareForPlay();
+    }
+
+    //--------------------------------------------------------------------------
+    //  Card Flip Effect
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function prepareCardViewEffect():IEffect
+    {
+        // Initialize are transition parameters, create our temporary
+        // transitionGroup, and parent our view elements.
+        setupTransition();
+
+        // Align underside 'face' of our card.
+        alignCardFaces(endView);
+
+        return createCardFlipAnimation(transitionGroup, endView.width);
+    }
+
+    /**
+     *  @private
+     */
+    private function prepareConsolidatedCardViewEffect():IEffect
+    {
+        // Initialize are transition parameters, create our temporary
+        // transitionGroup, and parent our view elements.
+        setupConsolidatedTransition();
+
+        // Align underside 'face' of our card.
+        alignCardFaces(targetNavigator);
+
+        return createCardFlipAnimation(transitionGroup, endView.width);
+    }
+
+    /**
+     *  @private
+     *  Shared helper routine which serves as our effect factory for both standard
+     *  and consolidated transitions.
+     */
+    protected function createCardFlipAnimation(flipTarget:UIComponent, width:Number):IEffect
+    {
+        // Now offset our transform center as appropriate for the transition direction
+        transitionGroup.transformX = viewWidth / 2;
+        transitionGroup.transformY = viewHeight / 2;
+
+        // Validate our transition group prior to the start of our animation.
+        transitionGroup.validateNow();
+
+        var animation:Animate = new Animate();
+
+        // Create motion path for our rotation property.
+        var vector:Vector.<MotionPath> = new Vector.<MotionPath>();
+        vector.push(new SimpleMotionPath(animatedProperty, 0, directionModifier * 180));
+
+        // Creation motion path for the target's z property.
+        var mp:MotionPath = new MotionPath("z");
+        vector.push(mp);
+
+        // Generate key frames for the z animation
+        var keyframes:Vector.<Keyframe> = new Vector.<Keyframe>();
+
+        var keyFrame:Keyframe = new Keyframe();
+        keyFrame.time = 0;
+        keyFrame.value = 0;
+        keyframes.push(keyFrame);
+
+        keyFrame = new Keyframe();
+        keyFrame.time = duration / 2;
+        keyFrame.value = width / 2;
+        keyframes.push(keyFrame);
+
+        keyFrame = new Keyframe();
+        keyFrame.time = duration;
+        keyFrame.value = 0;
+        keyframes.push(keyFrame);
+
+        mp.keyframes = keyframes;
+
+        // Configure the remainder of our animation parameters and install
+        // an update listener so that we can hide the old view once it's out
+        // of view.
+        animation.motionPaths = vector;
+        animation.target = flipTarget;
+        animation.duration = duration;
+        animation.addEventListener("effectUpdate", effectUpdateHandler);
+        animation.easer = easer;
+
+        return animation;
+    }
+
+    /**
+     *  @private
+     *  Update listener on our flip effect that hides our start view
+     *  once it is no longer visible to the user.
+     */
+    private function effectUpdateHandler(event:EffectEvent):void
+    {
+        var animatedProp:String = vertical ? "rotationX" : "rotationY";
+
+        if(Math.abs(transitionGroup[animatedProp]) > 90)
+        {
+            if (!consolidatedTransition)
+                startView.visible = false;
+            else
+                cachedNavigator.visible = false;

-	/**
-	 *  @inheritDoc
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	override protected function createViewEffect():IEffect
-	{
-		// Don't bother transitioning if we're missing views (or if we
-		// don't support the requested mode)
-		if (!startView || !endView || mode == FlipViewTransitionMode.CUBE)
-			return null;
-
-		// Initialize temporaries based on our currently flip direction.
-		vertical = (direction == ViewTransitionDirection.DOWN ||
-			direction == ViewTransitionDirection.UP);
-
-		var viewWidth:Number = endView.width;
-		var viewHeight:Number = endView.height;
-		var animatedProperty:String = vertical ? "rotationX" : "rotationY";
-
-		// Disable start view layout.
-		startViewProps = { includeInLayout:startView.includeInLayout };
-		startView.includeInLayout = false;
-
-		// Disable end view layout.
-		endViewProps = { includeInLayout:endView.includeInLayout };
-		endView.includeInLayout = false;
-
-		// Save our end view's transform matrix.
-		savedMatrix = endView.transform.matrix3D;
-
-		// In order for device text to render properly when negatively scaled, we
-		// must ensure our view has a transform matrix 3D active.
-		endView.z = .01;
-
-		// Mirror our end view so that it can serve as the reverse face of our
-		// card transition.
-		if (vertical)
-		{
-			endView.y += viewHeight;
-			endView.scaleY = -1;
-		}
-		else
-		{
-			endView.x += viewWidth;
-			endView.scaleX = -1;
-		}
-
-		// Create a temporary transition group to serve as the parent of our
-		// views while flipping.  Offset our transition group as necessary to
-		// ensure we flip relative to our center.
-		transitionGroup = new Group();
-		transitionGroup.includeInLayout=false;
-		addComponentToContainer(transitionGroup, UIComponent(endView.parent));
-		transitionGroup.addElement(endView);
-		transitionGroup.addElement(startView);
-
-		// Setup our transition group's perspective projection properties.
-		var projection:PerspectiveProjection = new PerspectiveProjection();
-		projection.fieldOfView = 45;
-		projection.projectionCenter = new Point(viewWidth / 2, viewHeight / 2);
-		transitionGroup.transform.perspectiveProjection = projection;
-		transitionGroup[animatedProperty] = 0;
-
-		// Now offset our transform center as appropriate for the transition direction
-		transitionGroup.transformX = viewWidth / 2;
-		transitionGroup.transformY = viewHeight / 2;
-
-		// Validate our transition group prior to the start of our animation.
-		transitionGroup.validateNow();
-
-		// Create and return our composite flip effect.
-		var directionModifier:int = (direction == ViewTransitionDirection.LEFT ||
-			direction == ViewTransitionDirection.DOWN) ? 1 : -1;
-
-		return createFlipEffect(transitionGroup, endView.width, animatedProperty, directionModifier);
-	}
-
-	/**
-	 *  @inheritDoc
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	override protected function createConsolidatedEffect():IEffect
-	{
-		// If we have no cachedNavigator then there is not much we can do.
-		if (!cachedNavigator || mode == FlipViewTransitionMode.CUBE)
-			return null;
-
-		// Add a temporary group to contain our snapshot view of the navigator
-		// while we animate.
-		transitionGroup = new Group();
-		transitionGroup.includeInLayout = false;
-		addComponentToContainer(transitionGroup, DisplayObject(targetNavigator).parent as UIComponent);
-
-		transitionGroup.addElement(targetNavigator);
-		cachedNavigator.includeInLayout = false;
-		transitionGroup.addElement(cachedNavigator);
-
-		transitionGroup.x = transitionGroup.y = 0;
-		transitionGroup.width = cachedNavigator.width;
-		transitionGroup.height = cachedNavigator.height;
-
-		// Initialize temporaries based on our currently flip direction.
-		vertical = (direction == ViewTransitionDirection.DOWN ||
-			direction == ViewTransitionDirection.UP);
-
-		var viewWidth:Number = targetNavigator.width;
-		var viewHeight:Number = targetNavigator.height;
-		var animatedProperty:String = vertical ? "rotationX" : "rotationY";
-
-		// Save our end view's transform matrix.
-		savedMatrix = targetNavigator.transform.matrix3D;
-
-		// In order for device text to render properly when negatively scaled, we
-		// must ensure our view has a transform matrix 3D active.
-		targetNavigator.z = .01;
-
-		// Mirror our end view so that it can serve as the reverse face of our
-		// card transition.
-		if (vertical)
-		{
-			targetNavigator.y += viewHeight;
-			targetNavigator.scaleY = -1;
-		}
-		else
-		{
-			targetNavigator.x += viewWidth;
-			targetNavigator.scaleX = -1;
-		}
-
-		// Setup our transition group's perspective projection properties.
-		var projection:PerspectiveProjection = new PerspectiveProjection();
-		projection.fieldOfView = 45;
-		projection.projectionCenter = new Point(viewWidth / 2 - 1, viewHeight / 2 - 1);
-		transitionGroup.transform.perspectiveProjection = projection;
-		transitionGroup[animatedProperty] = 0;
-
-		// Now offset our transform center as appropriate for the transition direction
-		transitionGroup.transformX = targetNavigator.width / 2;
-		transitionGroup.transformY = targetNavigator.height / 2;
-
-		navigatorProps.targetNavigatorIncludeInLayout = targetNavigator.includeInLayout;
-		targetNavigator.includeInLayout = false;
-
-		// Validate our transition group prior to the start of our animation.
-		transitionGroup.validateNow();
-
-		// Create and return our composite flip effect.
-		var directionModifier:int = (direction == ViewTransitionDirection.LEFT ||
-			direction == ViewTransitionDirection.DOWN) ? 1 : -1;
-
-		return createFlipEffect(transitionGroup, endView.width, animatedProperty, directionModifier);
-	}
-
-	/**
-	 *  @private
-	 *  Cleanup helper method.
-	 */
-	protected function deferredCleanUp():void
-	{
-
-		if (!consolidatedTransition && transitionGroup)
-		{
-			if (endView)
-				endView.transform.matrix3D = savedMatrix;
-
-			// Restore our views to their natural location.
-			if (startView && endView)
-			{
-				navigator.contentGroup.addElement(startView);
-				navigator.contentGroup.addElement(endView);
-			}
-
-			// Extract our temporary transition group.
-			Group(transitionGroup.parent).removeElement(transitionGroup);
-
-			// Restore startView properties.
-			if (startView)
-			{
-				startView.includeInLayout = startViewProps.includeInLayout;
-				startViewProps = null;
-			}
-
-			// Restore endView properties.
-			if (endView)
-			{
-				endView.includeInLayout = endViewProps.includeInLayout;
-				endViewProps = null;
-			}
-		}
-		else if (transitionGroup)
-		{
-			if (targetNavigator)
-				targetNavigator.transform.matrix3D = savedMatrix;
-
-			// Restore our views to their natural location.
-			removeComponentFromContainer(targetNavigator as UIComponent, transitionGroup as UIComponent);
-			addComponentToContainer(targetNavigator as UIComponent, transitionGroup.parent as UIComponent);
-			removeComponentFromContainer(transitionGroup as UIComponent, transitionGroup.parent as UIComponent);
-
-			// Restore targetNavigator properties.
-			targetNavigator.includeInLayout = navigatorProps.targetNavigatorIncludeInLayout;
-		}
-
-		transitionGroup = null;
-		cachedNavigator = null;
-
-		super.cleanUp();
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Private Methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @inheritDoc
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 2.5
-	 *  @productversion Flex 4.5
-	 */
-	override public function prepareForPlay():void
-	{
-		actionBarTransitionDirection = direction;
-		super.prepareForPlay();
-	}
-
-	/**
-	 *  @private
-	 *  Override transitionComplete so that we can defer clean up
-	 *  until after we've rendered the last frame of the 3d transition.
-	 */
-	override protected function transitionComplete():void
-	{
-		navigator.addEventListener("enterFrame", enterFrameHandler);
-	}
-
-	/**
-	 *  @private
-	 */
-	protected function enterFrameHandler(e:Event):void
-	{
-		navigator.removeEventListener("enterFrame", enterFrameHandler);
-
-		// Invoke our cleanup now that we've rendered the last frame of
-		// animation.
-		deferredCleanUp();
-
-		// Now dispatch our transition end event.
-		if (hasEventListener(FlexEvent.TRANSITION_END))
-			dispatchEvent(new FlexEvent(FlexEvent.TRANSITION_END));
-	}
-
-	/**
-	 *  @private
-	 *  Update listener on our flip effect that hides our start view
-	 *  once the end view can be seen.
-	 */
-	private function effectUpdateHandler(e:EffectEvent):void
-	{
-		var animatedProp:String = vertical ? "rotationX" : "rotationY";
-
-		if(Math.abs(transitionGroup[animatedProp]) > 90)
-		{
-			if (!consolidatedTransition)
-			    startView.visible = false;
-			else
-				cachedNavigator.visible = false;
-		}
-	}
-
-	/**
-	 *  @private
-	 *  Shared helper routine which serves as our effect factory for both standard
-	 *  and consolidated transitions.
-	 */
-	protected function createFlipEffect(flipTarget:UIComponent, width:Number,
-										animatedProperty:String, directionModifier:int):IEffect
-	{
-		var animation:Animate = new Animate();
-
-		// Create motion path for our rotation property.
-		var vector:Vector.<MotionPath> = new Vector.<MotionPath>();
-		vector.push(new SimpleMotionPath(animatedProperty, 0, directionModifier * 180));
-
-		// Creation motion path for the target's z property.
-		var mp:MotionPath = new MotionPath("z");
-		vector.push(mp);
-
-		// Generate key frames for the z animation
-		var keyframes:Vector.<Keyframe> = new Vector.<Keyframe>();
-
-		var keyFrame:Keyframe = new Keyframe();
-		keyFrame.time = 0;
-		keyFrame.value = 0;
-		keyframes.push(keyFrame);
-
-		keyFrame = new Keyframe();
-		keyFrame.time = duration / 2;
-		keyFrame.value = width / 2;
-		keyframes.push(keyFrame);
-
-		keyFrame = new Keyframe();
-		keyFrame.time = duration;
-		keyFrame.value = 0;
-		keyframes.push(keyFrame);
-
-		mp.keyframes = keyframes;
-
-		// Configure the remainder of our animation parameters and install
-		// an update listener so that we can hide the old view once it's out
-		// of view.
-		animation.motionPaths = vector;
-		animation.target = flipTarget;
-		animation.duration = duration;
-		animation.addEventListener("effectUpdate", effectUpdateHandler);
-		animation.easer = easer;
-
-		return animation;
-	}
+            event.target.removeEventListener("effectUpdate", effectUpdateHandler);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //  Cube Flip Effect
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function prepareCubeViewEffect():IEffect
+    {
+        // Initialize are transition parameters, create our temporary
+        // transitionGroup, and parent our view elements.
+        setupTransition();
+
+        // Position the 'faces' of our cube.
+        alignCubeFaces(startView, endView);
+
+        // Construct our animation sequence now that actors are configured.
+        return createCubeFlipAnimation(transitionGroup, vertical ? viewHeight : viewWidth);
+    }
+
+    /**
+     *  @private
+     */
+    private function prepareConsolidatedCubeViewEffect():IEffect
+    {
+        // Initialize are transition parameters, create our temporary
+        // transitionGroup, and parent our view elements.
+        setupConsolidatedTransition();
+
+        // Position the 'faces' of our cube.
+        alignCubeFaces(cachedNavigator, targetNavigator);
+
+        // Construct our animation sequence now that actors are configured.
+        return createCubeFlipAnimation(transitionGroup, vertical ? viewHeight : viewWidth);
+    }
+
+    /**
+     *  @private
+     *  Shared helper routine which serves as our effect factory for both standard
+     *  and consolidated transitions.
+     */
+    protected function createCubeFlipAnimation(flipTarget:UIComponent, depth:Number):IEffect
+    {
+        // Validate our transition group prior to the start of our animation.
+        transitionGroup.validateNow();
+
+        var p:Parallel = new Parallel();
+        p.target = flipTarget;
+
+        // Zoom out
+        var m1:Move3D = new Move3D();
+        m1.zTo = depth / 1.45;
+        m1.duration = duration/2;
+        m1.addEventListener("effectUpdate", cubeEffectUpdateHandler);
+
+        // Zoom back in
+        var m2:Move3D = new Move3D();
+        m2.zTo = depth / 2;
+        m2.duration = duration/2;
+        m2.startDelay = duration/2;
+
+        // Rotate our 'cube'.
+        var r1:Rotate3D = new Rotate3D();
+        if (animatedProperty == "rotationY")
+            r1.angleYTo= directionModifier * 90;
+        else
+            r1.angleXTo = directionModifier * 90;
+        r1.duration = duration;
+
+        p.addChild(m1);
+        p.addChild(m2);
+        p.addChild(r1);
+
+        return p;
+    }
+
+    /**
+     *  @private
+     *  Update listener on our cube flip effect that hides our start view
+     *  once it's no longer facing the user.
+     */
+    private function cubeEffectUpdateHandler(event:EffectEvent):void
+    {
+        var face:DisplayObject = (!consolidatedTransition) ?
+            startView : cachedNavigator.displayObject;
+
+        var frontFacing:Boolean = isFrontFacing(face);
+        if (!frontFacing)
+        {
+            face.visible = false;
+            event.target.removeEventListener("effectUpdate", cubeEffectUpdateHandler);
+        }
+    }
+
+    /**
+     *  @private
+     *  Determine if a given display object with 2.5d transform
+     *  is front facing, by testing the winding direction of three
+     *  points on the object translated to user viewport (via cross
+     *  product of vectors).
+     */
+    private function isFrontFacing(target:DisplayObject):Boolean
+    {
+        var pA:Point = target.localToGlobal( POINT_A );
+        var pB:Point = target.localToGlobal( POINT_B );
+        var pC:Point = target.localToGlobal( POINT_C );
+
+        return (pB.x-pA.x) * (pC.y-pA.y) - (pB.y-pA.y) * (pC.x-pA.x) > 0;
+    }
+
+    private static const POINT_A:Point = new Point(0,   0);
+    private static const POINT_B:Point = new Point(100, 0);
+    private static const POINT_C:Point = new Point(0, 100);
+
+    //--------------------------------------------------------------------------
+    // Shared helpers
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function alignCardFaces(face:DisplayObject):void
+    {
+        // In order for device text to render properly when negatively scaled, we
+        // must ensure our view has a transform matrix 3D active.
+        face.z = .01;
+
+        // Mirror our end view so that it can serve as the reverse face of our
+        // card transition.
+        if (vertical)
+        {
+            face.y += viewHeight;
+            face.scaleY = -1;
+        }
+        else
+        {
+            face.x += viewWidth;
+            face.scaleX = -1;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function alignCubeFaces(startFace:Object, endFace:Object):void
+    {
+        // Position the xform center of outer transitionGroup.
+        transitionGroup.x = viewWidth / 2;
+        transitionGroup.y = viewHeight / 2;
+        transitionGroup.z = vertical ? (viewHeight / 2) : (viewWidth / 2);
+
+        // Position the 'faces' of our cube.
+        if (vertical)
+        {
+            endFace.x = -viewWidth / 2;
+            endFace.y = -directionModifier * viewHeight / 2;
+            endFace.z = directionModifier * viewHeight / 2;
+            endFace["rotationX"] = -directionModifier * 90;
+        }
+        else
+        {
+            endFace.x = directionModifier * viewWidth / 2;
+            endFace.y = -viewHeight / 2;
+            endFace.z = -directionModifier * viewWidth / 2;
+            endFace["rotationY"] = -directionModifier * 90;
+        }
+
+        startFace.x = -viewWidth/2;
+        startFace.y = -viewHeight/2;
+        startFace.z = vertical ? (-viewHeight/2) : (-viewWidth/2);
+    }
+
+    /**
+     *  @private
+     */
+    private function createCenteredProjection():PerspectiveProjection
+    {
+        var projection:PerspectiveProjection = new PerspectiveProjection();
+        projection.fieldOfView = 45;
+        projection.projectionCenter = new Point(viewWidth / 2, viewHeight / 2);
+        return projection;
+    }
+
+    /**
+     *  @private
+     *  Initializes our vertical, viewWidth, viewHeight, animatedProperty,
+     *  and directionModifier properties.
+     */
+    private function initTransitionParameters(width:Number, height:Number):void
+    {
+        vertical = (direction == ViewTransitionDirection.DOWN ||
+            direction == ViewTransitionDirection.UP);
+
+        viewWidth = width;
+        viewHeight = height;
+
+        animatedProperty = vertical ? "rotationX" : "rotationY";
+
+        directionModifier = (direction == ViewTransitionDirection.LEFT ||
+            direction == ViewTransitionDirection.DOWN) ? 1 : -1;
+    }
+
+    /**
+     *  @private
+     *  Initialize are transition parameters, create our temporary
+     *  transitionGroup, and parent our view elements.
+     */
+    private function setupTransition():void
+    {
+        // Initialize temporaries based on our currently flip direction.
+        initTransitionParameters(endView.width, endView.height);
+
+        // Disable start view layout.
+        startViewProps = { includeInLayout:startView.includeInLayout };
+        startView.includeInLayout = false;
+
+        // Disable end view layout.
+        endViewProps = { includeInLayout:endView.includeInLayout };
+        endView.includeInLayout = false;
+
+        // Save our end view's transform matrix.
+        savedEndMatrix = endView.transform.matrix3D;
+
+        // Create a temporary transition group to serve as the parent of our
+        // views while flipping.  Offset our transition group as necessary to
+        // ensure we flip relative to our center.
+        transitionGroup = new Group();
+        transitionGroup.includeInLayout=false;
+        addComponentToContainer(transitionGroup, UIComponent(endView.parent));
+        transitionGroup.addElement(endView);
+        transitionGroup.addElement(startView);
+
+        // Setup our transition group's perspective projection properties.
+        transitionGroup.transform.perspectiveProjection = createCenteredProjection();
+    }
+
+    /**
+     *  @private
+     *  Initialize are transition parameters, create our temporary
+     *  transitionGroup, and parent our view elements (for a consolidated
+     *  transition).
+     */
+    private function setupConsolidatedTransition():void
+    {
+        // Initialize temporaries based on our currently flip direction.
+        initTransitionParameters(targetNavigator.width, targetNavigator.height);
+
+        // Add a temporary group to contain our snapshot view of the navigator
+        // while we animate.
+        transitionGroup = new Group();
+        transitionGroup.includeInLayout = false;
+        addComponentToContainer(transitionGroup, DisplayObject(targetNavigator).parent as UIComponent);
+
+        transitionGroup.addElement(targetNavigator);
+        cachedNavigator.includeInLayout = false;
+        transitionGroup.addElement(cachedNavigator);
+
+        transitionGroup.x = transitionGroup.y = 0;
+        transitionGroup.width = cachedNavigator.width;
+        transitionGroup.height = cachedNavigator.height;
+
+        // Save our end view's transform matrix.
+        savedEndMatrix = targetNavigator.transform.matrix3D;
+
+        // Setup our transition group's perspective projection properties.
+        transitionGroup.transform.perspectiveProjection = createCenteredProjection();
+
+        // Disable layout for our targetNavigator temporarily.
+        navigatorProps.targetNavigatorIncludeInLayout = targetNavigator.includeInLayout;
+        targetNavigator.includeInLayout = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //  Cleanup related methods.
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Override transitionComplete so that we can defer clean up
+     *  until after we've rendered the last frame of the 3d transition.
+     */
+    override protected function transitionComplete():void
+    {
+        navigator.addEventListener("enterFrame", enterFrameHandler);
+    }
+
+    /**
+     *  @private
+     */
+    private function enterFrameHandler(e:Event):void
+    {
+        navigator.removeEventListener("enterFrame", enterFrameHandler);
+
+        // Invoke our cleanup now that we've rendered the last frame of
+        // animation.
+        deferredCleanUp();
+
+        // Now dispatch our transition end event.
+        if (hasEventListener(FlexEvent.TRANSITION_END))
+            dispatchEvent(new FlexEvent(FlexEvent.TRANSITION_END));
+    }
+
+    /**
+     *  @private
+     *  Cleanup method which restores any temporary properties set up
+     *  on our view elements.
+     */
+    protected function deferredCleanUp():void
+    {
+
+        if (!consolidatedTransition && transitionGroup)
+        {
+            if (endView)
+                endView.transform.matrix3D = savedEndMatrix;
+
+            // Restore our views to their natural location.
+            if (startView && endView)
+            {
+                navigator.contentGroup.addElement(startView);
+                navigator.contentGroup.addElement(endView);
+            }
+
+            // Extract our temporary transition group.
+            Group(transitionGroup.parent).removeElement(transitionGroup);
+
+            // Restore startView properties.
+            if (startView)
+            {
+                startView.includeInLayout = startViewProps.includeInLayout;
+                startViewProps = null;
+            }
+
+            // Restore endView properties.
+            if (endView)
+            {
+                endView.includeInLayout = endViewProps.includeInLayout;
+                endViewProps = null;
+            }
+        }
+        else if (transitionGroup)
+        {
+            if (targetNavigator)
+                targetNavigator.transform.matrix3D = savedEndMatrix;
+
+            // Restore our views to their natural location.
+            removeComponentFromContainer(targetNavigator as UIComponent, transitionGroup as UIComponent);
+            addComponentToContainer(targetNavigator as UIComponent, transitionGroup.parent as UIComponent);
+            removeComponentFromContainer(transitionGroup as UIComponent, transitionGroup.parent as UIComponent);
+
+            // Restore targetNavigator properties.
+            targetNavigator.includeInLayout = navigatorProps.targetNavigatorIncludeInLayout;
+        }
+
+        transitionGroup = null;
+        cachedNavigator = null;
+
+        super.cleanUp();
+    }
+

 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20272
Author:   cframpto@adobe.com
Date:     2011-02-10T18:56:08.256640Z

Log Message:
-----------
Per Matt's request, fix up ASdoc for leading and letterSpacing styles.

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: compiled and ran asdoc and visually inspected results
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as

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

--- frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as
+++ frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as
@@ -297,7 +297,15 @@
 [Style(name="kerning", type="String", enumeration="auto,on,off", inherit="yes")]

 /**
+ *  Additional vertical space between lines of text.
+ *
+ *
For the Spark theme, this is not supported.  See lineHeight.

+ *
+ *
For the Mobile theme, see
+ *  spark.components.supportClasses.StyleableTextField.leading.

+ *
  *  @see spark.components.supportClasses.StyleableTextField#style:leading
+ *  @see #style:lineHeight
  *
  *  @langversion 3.0
  *  @playerversion Flash 10.1
@@ -307,8 +315,18 @@
 [Style(name="leading", type="Number", format="Length", inherit="yes", theme="mobile")]

 /**
+ *  The number of additional pixels to appear between each character.
+ *
+ *
For the Spark theme, this is not supported.  See trackingLeft
+ *  and trackingRight.

+ *
+ *
For the Mobile theme, see
+ *  spark.components.supportClasses.StyleableTextField.letterSpacing.

+ *
  *  @see spark.components.supportClasses.StyleableTextField#style:letterSpacing
- *
+ *  @see #style:trackingLeft
+ *  @see #style:trackingRight
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10.1
  *  @playerversion AIR 2.0
@@ -337,11 +355,12 @@
  *  Leading controls for the text.
  *
  *
For the Spark theme, see
- *  flashx.textLayout.formats.ITextLayoutFormat.lineHeight

- *
- *
For the Mobile theme, this is not supported.

+ *  flashx.textLayout.formats.ITextLayoutFormat.lineHeight.

+ *
+ *
For the Mobile theme, this is not supported.  See leading.

  *
  *  @see flashx.textLayout.formats.ITextLayoutFormat#lineHeight
+ *  @see #style:leading
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


Added a repeatCount parameter to SoundSequencer.cue

--- raw/src/org/yellcorp/lib/sound/SoundSequencer.as
+++ raw/src/org/yellcorp/lib/sound/SoundSequencer.as
@@ -42,10 +42,17 @@
         sequenceSampleLength = 0;
     }

-    public function cue(sound:Sound, sample:int):void
-    {
-        var newCue:Cue = new Cue(sound, sample);
-        cues.push(newCue);
+    public function cue(sound:Sound, sample:int, repeatCount:int = 0):void
+    {
+        var newCue:Cue;
+
+        do {
+            newCue = new Cue(sound, sample);
+            cues.push(newCue);
+            sample += newCue.length;
+            repeatCount--;
+        } while (repeatCount >= 0);
+
         if (newCue.endSample > sequenceSampleLength)
         {
             sequenceSampleLength = newCue.endSample;


M sceneBindings.viewportWidth and sceneBindings.viewportHeight do not dispatch changes all the time anymore

--- src/aerys/minko/scene/controller/scene/RenderingController.as
+++ src/aerys/minko/scene/controller/scene/RenderingController.as
@@ -65,6 +65,9 @@
 		private var _postProcessingScene		: Scene			= null;
 		private var _postProcessingProperties	: DataProvider	= new DataProvider();

+		private var _lastViewportWidth			: Number		= 0;
+		private var _lastViewportHeight			: Number		= 0;
+
 		/**
 		 * Index meshes by their own databinding.
 		 *   * this is required to handle meshBindings.properyChange without
@@ -222,7 +225,7 @@
 			context.enableErrorChecking = (Minko.debugLevel & DebugLevel.CONTEXT) != 0;

 			// sort passes
-			if (!_passesAreSorted && numPasses != 0)
+			if (!_passesAreSorted && numPasses > 1)
 			{
 				for (i = 0; i < numPasses; ++i)
 					sortValues[i] = -(_passes[i] as ShaderInstance).settings.priority;
@@ -327,12 +330,19 @@
 												target 		: BitmapData,
 												time		: Number) : void
 		{
-			//_scene.bindings.setProperty("time", time);
-			_scene.properties.setProperties({
-				time			: time,
-				viewportWidth	: viewport.width,
-				viewportHeight	: viewport.height
-			});
+			var viewportWidth	: Number = viewport.width;
+			var viewportHeight	: Number = viewport.height;
+
+			_scene.properties.setProperty("time", time);
+
+			if (viewportWidth != _lastViewportWidth)
+				_scene.properties.setProperty('viewportWidth', viewport.width);
+
+			if (viewportHeight != _lastViewportHeight)
+				_scene.properties.setProperty('viewportHeight', viewport.height);
+
+			_lastViewportWidth	= viewportWidth;
+			_lastViewportHeight	= viewportHeight
 		}

 		private function sceneExitFrameHandler(scene 	: Scene,


add (per key) up/down signals to KeyboardManager

--- src/aerys/minko/type/KeyboardManager.as
+++ src/aerys/minko/type/KeyboardManager.as
@@ -5,7 +5,14 @@

 	public final class KeyboardManager
 	{
-		private var _keys	: Array	= [];
+		public static const NO_KEY	: uint		= uint(-1);
+
+		private var _keys			: Array		= [];
+
+		private var _downSignals	: Array		= [];
+		private var _upSignals		: Array		= [];
+		private var _keyDown		: Signal	= new Signal('KeyboardManager.keyDown');
+		private var _keyUp			: Signal	= new Signal('KeyboardManager.keyDown');

 		public function KeyboardManager()
 		{
@@ -23,14 +30,42 @@
 			dispatcher.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
 		}

+		public function keyDown(keyCode : uint = 0xffffffff) : Signal
+		{
+			if (keyCode == NO_KEY)
+				return _keyDown;
+			else
+				return _downSignals[keyCode] || (_downSignals[keyCode] = new Signal('KeyDown[' + keyCode + ']'));
+		}
+
+		public function keyUp(keyCode : uint = 0xffffffff) : Signal
+		{
+			if (keyCode == NO_KEY)
+				return _keyUp;
+			else
+				return _upSignals[keyCode] || (_upSignals[keyCode] = new Signal('KeyUp[' + keyCode + ']'));
+		}
+
 		private function keyDownHandler(event : KeyboardEvent) : void
 		{
-			_keys[event.keyCode] = true;
+			var keyCode : uint		= event.keyCode;
+			var signal 	: Signal 	= _downSignals[keyCode] as Signal;
+
+			_keys[keyCode] = true;
+
+			if (signal != null)
+				signal.execute(this, keyCode);
 		}

 		private function keyUpHandler(event : KeyboardEvent) : void
 		{
-			_keys[event.keyCode] = false;
+			var keyCode : uint		= event.keyCode;
+			var signal 	: Signal 	= _upSignals[keyCode] as Signal;
+
+			_keys[keyCode] = false;
+
+			if (signal != null)
+				signal.execute(this, keyCode);
 		}

 		public function keyIsDown(keyCode : uint) : Boolean


Added y offset to iconButton to center text

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

--- src/laml/display/IconButton.as
+++ src/laml/display/IconButton.as
@@ -11,7 +11,7 @@
 	public class IconButton extends Button {
 		private var classId:String = generateId();
 		private var ICON:String = classId + "_icon_button_icon";
-		private var LABEL:String = classId + "_icon_button_label";
+		private var LABEL:String = classId + "_icon_button_label";
 		private var ICON_CONTAINER:String = classId + "_icon_container";

 		private var iconComponent:Image;
@@ -64,11 +64,12 @@
 			}
 			else {
 				iconComponent.visible = true;
-				iconComponent.x = iconContainer.paddingLeft;
+				iconComponent.x = iconContainer.paddingLeft;
 				iconComponent.y = (h - iconComponent.height) / 2;

 				var labelOffset:Number = (iconComponent.x * 2) + iconComponent.width;
 				label.x = labelOffset;
+				label.y = (h - label.height)/2 - 2;
 				label.width = w - labelOffset;
 			}
 		}
@@ -143,7 +144,7 @@
 		}

 		protected function get configXml():XML {
-			var xml:XML = <HBox id={ICON_CONTAINER} width="100%" height="100%" padding="3" xmlns="laml.display">
+			var xml:XML = <HBox id={ICON_CONTAINER} width="100%" height="100%" padding="3" xmlns="laml.display">
 							<Image id={ICON} preferredWidth="1" preferredHeight="1" backgroundColor="#CCCCCC"></Image>
 							<Label id={LABEL} width="100%" height="100%"></Label>
 						</HBox>;


FLEX-34852 Added unit tests for numeric and date types.

--- frameworks/projects/framework/tests/FLEX_34852_Tests.as
+++ frameworks/projects/framework/tests/FLEX_34852_Tests.as
@@ -23,6 +23,7 @@
     import mx.collections.IList;
     import mx.collections.ListCollectionView;
     import mx.collections.Sort;
+    import mx.collections.SortFieldCompareTypes;

     import org.flexunit.asserts.assertEquals;

@@ -42,21 +43,115 @@
         }

         [Test]
-        public function test_simple_ascending_sort_by_complex_fields():void
+        public function test_simple_ascending_sort_by_complex_string_fields():void
         {
             //given
             var from4To0:IList = generateVOs(5, true);
             _sut.addAll(from4To0); //values["address.street"]: Street4, Street3, Street2, Street1, Street0

-            const sortByIndexAscending:Sort = new Sort();
-            sortByIndexAscending.fields = [new ComplexSortField("address.street", false, false, false)];
-            _sut.sort = sortByIndexAscending;
+            const sortByStreetAscending:Sort = new Sort();
+            sortByStreetAscending.fields = [new ComplexSortField("address.street", false, false, false)];
+            _sut.sort = sortByStreetAscending;

             //when
             _sut.refresh(); //should be: Street0, Street1, Street2, Street3, Street4

             //then
             assertIndexesAre([0, 1, 2, 3, 4]);
+        }
+
+        [Test]
+        public function test_simple_descending_sort_by_complex_string_fields():void
+        {
+            //given
+            var from0To4:IList = generateVOs(5);
+            _sut.addAll(from0To4); //values["address.street"]: Street0, Street1, Street2, Street3, Street4
+
+            const sortByStreetDescending:Sort = new Sort();
+            sortByStreetDescending.fields = [new ComplexSortField("address.street", false, true, false)];
+            _sut.sort = sortByStreetDescending;
+
+            //when
+            _sut.refresh(); //should be: Street4, Street3, Street2, Street1, Street0
+
+            //then
+            assertIndexesAre([4, 3, 2, 1, 0]);
+        }
+
+        [Test]
+        public function test_simple_ascending_sort_by_complex_date_fields():void
+        {
+            //given
+            var from2004To2000:IList = generateVOs(5, true);
+            _sut.addAll(from2004To2000); //values["address.dateMovedIn"].getYear(): 2004, 2003, 2002, 2001, 2000
+
+            const sortByDateMovedInAscending:Sort = new Sort();
+            var complexSortField:ComplexSortField = new ComplexSortField("address.dateMovedIn", false, false, false);
+            complexSortField.sortCompareType = SortFieldCompareTypes.DATE;
+            sortByDateMovedInAscending.fields = [complexSortField];
+            _sut.sort = sortByDateMovedInAscending;
+
+            //when
+            _sut.refresh(); //should be: 2000, 2001, 2002, 2003, 2004
+
+            //then
+            assertIndexesAre([0, 1, 2, 3, 4]);
+        }
+
+        [Test]
+        public function test_simple_descending_sort_by_complex_date_fields():void
+        {
+            //given
+            var from2000To2004:IList = generateVOs(5);
+            _sut.addAll(from2000To2004); //values["address.dateMovedIn"].getYear(): 2000, 2001, 2002, 2003, 2004
+
+            const sortByDateMovedInDescending:Sort = new Sort();
+            var complexSortField:ComplexSortField = new ComplexSortField("address.dateMovedIn", false, true, false);
+            complexSortField.sortCompareType = SortFieldCompareTypes.DATE;
+            sortByDateMovedInDescending.fields = [complexSortField];
+            _sut.sort = sortByDateMovedInDescending;
+
+            //when
+            _sut.refresh(); //should be: 2004, 2003, 2002, 2001, 2000
+
+            //then
+            assertIndexesAre([4, 3, 2, 1, 0]);
+        }
+
+        [Test]
+        public function test_simple_ascending_sort_by_complex_number_fields():void
+        {
+            //given
+            var from4To0:IList = generateVOs(5, true);
+            _sut.addAll(from4To0); //values["address.houseNumber"]: 4, 3, 2, 1, 0
+
+            const sortByHouseNumberAscending:Sort = new Sort();
+            sortByHouseNumberAscending.fields = [new ComplexSortField("address.houseNumber", false, false, true)];
+            _sut.sort = sortByHouseNumberAscending;
+
+            //when
+            _sut.refresh(); //should be: 0, 1, 2, 3, 4
+
+            //then
+            assertIndexesAre([0, 1, 2, 3, 4]);
+        }
+
+        [Test]
+        public function test_simple_descending_sort_by_complex_number_fields():void
+        {
+            //given
+            var from4To0:IList = generateVOs(5);
+            _sut.addAll(from4To0); //values["address.houseNumber"]: 0, 1, 2, 3, 4
+
+            const sortByHouseNumberDescending:Sort = new Sort();
+            sortByHouseNumberDescending.fields = [new ComplexSortField("address.houseNumber", false, true, true)];
+            _sut.sort = sortByHouseNumberDescending;
+
+            //when
+            _sut.refresh(); //should be: 4, 3, 2, 1, 0
+
+            //then
+            assertIndexesAre([4, 3, 2, 1, 0]);
         }

@@ -93,7 +188,7 @@

         private static function generateOneObject(i:Number):FLEX_34852_VO
         {
-            return new FLEX_34852_VO(i, "Object"+i, "Street"+i);
+            return new FLEX_34852_VO(i, "Object", "Street");
         }
     }
 }
@@ -113,7 +208,7 @@
     {
         this.index = index;
         this.name = namePrefix + index;
-        this.address = new FLEX_34852_AddressVO(streetPrefix + index);
+        this.address = new FLEX_34852_AddressVO(streetPrefix + index, Math.floor(index), new Date(2000 + Math.floor(index), 0, 0, 0, 0, 0, 1));
     }
 }

@@ -122,8 +217,16 @@
     [Bindable]
     public var street:String;

-    public function FLEX_34852_AddressVO(street:String)
+    [Bindable]
+    public var houseNumber:int;
+
+    [Bindable]
+    public var dateMovedIn:Date;
+
+    public function FLEX_34852_AddressVO(street:String, houseNumber:int, dateMovedIn:Date)
     {
         this.street = street;
+        this.houseNumber = houseNumber;
+        this.dateMovedIn = dateMovedIn;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23284
Author:   cframpto@adobe.com
Date:     2012-01-10T15:28:39.900752Z

Log Message:
-----------
Replace Macromedia copyright headers with Apache copyright headers.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/advancedgrids/data_management.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/charts/charts-3.0.0.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/charts/src/mx/charts/chartClasses/StackedSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/charts/charts.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/framework/src/mx/events/InvalidateRequestData.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/rpc/src/mx/netmon/NetworkMonitor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/charts/MXCharts.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/charts/charts-4.X.0.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/advancedgrids/data_management-3.0.0.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/framework/src/mx/states/AddItems.as</path>

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

--- frameworks/projects/rpc/src/mx/netmon/NetworkMonitor.as
+++ frameworks/projects/rpc/src/mx/netmon/NetworkMonitor.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
-//  All Rights Reserved. The following is Source Code and is subject to all
-//  restrictions on such code as contained in the End User License Agreement
-//  accompanying this product. If you have received this file from a source
-//  other than Adobe, then your use, modification, or distribution of this file
-//  requires the prior written permission of Adobe.
+//  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
+//
+//      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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 12052
Author:   clucier@adobe.com
Date:     2009-11-20T18:38:19.094091Z

Log Message:
-----------
We now issue runtime warnings for incompatible embedded fonts as we detect their use.

QE notes: You might want to create a couple tests around this.
Doc notes: None.
Bugs: SDK-23920.
Reviewer: Alex, Darrell
Tests run: Checkin
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/bundles/en_US/core.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/EmbeddedFontRegistry.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/framework/src/mx/core/UITextFormat.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IEmbeddedFontRegistry.as</path>

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

--- frameworks/projects/spark/src/mx/core/UIFTETextField.as
+++ frameworks/projects/spark/src/mx/core/UIFTETextField.as
@@ -2082,7 +2082,7 @@
                 var fontModuleFactory:IFlexModuleFactory =
                     embeddedFontRegistry.getAssociatedModuleFactory(
                     textFormat.font, textFormat.bold, textFormat.italic,
-                        this, moduleFactory);
+                        this, moduleFactory, creatingSystemManager(), true);

                 // if we found the font, then it is embedded.
                 // Some fonts are not listed in info(), so are not in the above registry.
@@ -2091,15 +2091,6 @@
                 {
                     fontContext = ISWFContext(fontModuleFactory);
                     embedFonts = true;
-                }
-                else
-                {
-                    var sm:ISystemManager = creatingSystemManager();
-                    embedFonts = sm != null && sm.isFontFaceEmbedded(textFormat);
-                    if (embedFonts)
-                        fontContext = ISWFContext(sm);
-                    else
-                        fontContext = null;
                 }
             }
             else


Well, I'm not sure there's anything I can do to work around this.
I'm recreating the video and the bitmap when I change camera dimensions.
But it seems that once a video is snapshotted into a bitmap,
the camera somehow remembers the resolution, and future snapshots of
a new video object attached to that camera always end up at the same size.
It doesn't make any sense and I can't even work around it because
the first snapshot could have happened outside of this code.
I did:
- show some text behind the video, so that selecting a non-working camera
gives a little feedback.
- cleaned up NPE that happened if clearSnapshot() was called when it was
already cleared.
- Detach the camera from the old video before setting up a new one

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@467 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flash/CameraSnapshotter.as
+++ src/as/com/threerings/flash/CameraSnapshotter.as
@@ -7,8 +7,14 @@
 import flash.display.BitmapData;
 import flash.display.Sprite;

+import flash.events.StatusEvent;
+
 import flash.media.Camera;
 import flash.media.Video;
+
+import flash.text.TextField;
+
+import com.threerings.util.MethodQueue;

 // TODO: use PreferredCamera?
 public class CameraSnapshotter extends Sprite
@@ -27,6 +33,11 @@
      */
     public function CameraSnapshotter (cameraName :String = null)
     {
+        // create a label behind the videos that only shows up if a camera doesn't work
+        var tf :TextField = new TextField();
+        tf.text = "Camera unavailable.";
+        addChild(tf);
+
         setCameraName(cameraName);
     }

@@ -96,6 +107,7 @@
         clearSnapshot();
         removeChild(_video);
         _camera.setMode(width, height, fps, favorArea);
+
         attachVideo();
     }

@@ -118,8 +130,10 @@
         if (_camera == null) {
             return;
         }
+        if (_bitmap.parent != null) {
+            removeChild(_bitmap);
+        }
         if (_video.parent == null) {
-            removeChild(_bitmap);
             addChild(_video);
         }
     }
@@ -134,6 +148,11 @@

     protected function attachVideo () :void
     {
+        if (_video != null) {
+            // shut down the old video
+            _video.attachCamera(null);
+        }
+
         _video = new Video(_camera.width, _camera.height);
         // the constructor args don't seem to do dick, so we set the values again...
         _video.width = _camera.width;


Transferred from the Adobe Open Source Subversion Repository

Revision: 21061
Author:   chiedozi@adobe.com
Date:     2011-04-12T18:12:33.704631Z

Log Message:
-----------
SlideViewTransition now clips the navigator when animating between views

QE notes:
Doc notes:
Bugs: SDK-29309
Reviewer: Jason SJ
Tests run: checkintests-mobile
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/trunk/frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
@@ -15,6 +15,7 @@
 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.geom.Point;
+import flash.geom.Rectangle;

 import mx.core.IVisualElement;
 import mx.core.mx_internal;
@@ -694,6 +695,10 @@
      */
     override protected function cleanUp():void
     {
+        // Clear the scrollRect that the transition applied to the navigator
+        if (navigatorProps.scrollRectSet)
+            navigator.scrollRect = null;
+
         if (startView)
         {
             startView.includeInLayout = startViewProps.includeInLayout;
@@ -800,6 +805,8 @@
     override public function prepareForPlay():void
     {
         actionBarTransitionDirection = direction;
+        applyScrollRect();
+
         super.prepareForPlay();
     }

@@ -815,5 +822,22 @@
         return targetNavigator.globalToLocal(stagePoint);
     }

+    /**
+     *  @private
+     *  This method sets the scrollRect of the navigator that is being animated.
+     *  An mx_internal method was created to avoid any issues that may arise by
+     *  adding this functionality in the Flex 4.5.1 dot release.  Developers
+     *  can override this method to do nothing to revert to previous implementations.
+     */
+    // TODO (chiedozi): Eventually get rid of this method
+    mx_internal function applyScrollRect():void
+    {
+        // The scrollRect is only set if the navigator doesn't have one
+        if (!navigator.scrollRect)
+        {
+            navigatorProps.scrollRectSet = true;
+            navigator.scrollRect = new Rectangle(0, 0, navigator.width, navigator.height);
+        }
+    }
 }
 }


Add utility to generate unique label.

Add utility to generate unique label.

--- src/com/esri/builder/supportClasses/LabelUtil.as
+++ src/com/esri/builder/supportClasses/LabelUtil.as
@@ -17,6 +17,7 @@
 {

 import mx.core.FlexGlobals;
+import mx.utils.StringUtil;

 import spark.utils.LabelUtil;

@@ -55,5 +56,26 @@
     {
         return spark.utils.LabelUtil.itemToLabel(item, labelField, labelFunction);
     }
+
+    public static function generateUniqueLabel(fileNameTemplate:String, usedNames:Array, isUniqueFunction:Function = null):String
+    {
+        var currentID:int = 1;
+        var uniqueLabel:String;
+
+        var uniquenessFunction:Function =
+            isUniqueFunction != null ? isUniqueFunction : isNameUnique;
+
+        do
+        {
+            uniqueLabel = StringUtil.substitute(fileNameTemplate, currentID++);
+        } while (!uniquenessFunction(uniqueLabel, usedNames));
+
+        return uniqueLabel;
+    }
+
+    private static function isNameUnique(name:String, usedNames:Array):Boolean
+    {
+        return usedNames.indexOf(name) == -1;
+    }
 }
 }


Small fix

Small fix

--- Impetus.swf/Impetus.as
+++ Impetus.swf/Impetus.as
@@ -48,7 +48,7 @@
             }
         }

-        public function setPosChannel(url:String, id:int, int pos):void
+        public function setPosChannel(url:String, id:int, pos:int):void
         {
             var c:ImpetusChannel = this.getSound(url).get(id);


Communications (DB Service integration (incomplete))

Applying Database Service to replace Remote MSQL database for usage of
public keys.

--- src/sfxworks/Communications.as
+++ src/sfxworks/Communications.as
@@ -25,6 +25,7 @@
 	import flash.net.URLRequest;
 	import flash.utils.ByteArray;
 	import flash.utils.Timer;
+	import sfxworks.services.DatabaseService;

 	import sfxworks.NetworkActionEvent;
 	import sfxworks.NetworkEvent;
@@ -38,6 +39,7 @@
 		private var _netConnection:NetConnection;
 		private var mysqlConnection:Connection;

+		private var _databaseService:DatabaseService;

 		//MyIdentity
 		private var _name:String;
@@ -150,7 +152,7 @@

 		public function addWantObject(groupName:String, startIndex:Number, endIndex:Number):void //Requests objects from the group.
 		{
-			groups[groupName.indexOf(groupName)].addWantObjects(startIndex, endIndex);
+			groups[groupName.indexOf(groupName)].addWantObjects(startInded, endIndex);
 		}

 		public function addHaveObject(groupName:String, startIndex:Number, endIndex:Number):void //Adds a list of object the service, or whatever calls on commuication has.
@@ -231,7 +233,7 @@
 					trace("COMMUNICATIONS: Net connection successful. P2P public DB connection.");
 					_nearID = _netConnection.nearID;

-					//p2pdb();
+					p2pdb();
 					//P2P Publid data storage.

 					break;
@@ -290,8 +292,14 @@
 			getGroup(groupName).sendToAllNeighbors(object);
 		}

+
+		//    v
 		private function p2pdb():void
 		{
+			_databaseService = new DatabaseService(this);
+			_databaseService.connectToDatabase("CORE-COMMUNICATIONS-PUBLICDB");
+			_databaseService
+
 			var gspec:GroupSpecifier = new GroupSpecifier("CORE-COMMUNICATIONS-PUBLICDB");
 			gspec.objectReplicationEnabled = true;
 			gspec.serverChannelEnabled = true;
@@ -300,41 +308,7 @@
 			this.addGroup("CORE-COMMUNICATIONS-PUBLICDB", gspec);
 			addEventListener(NetworkGroupEvent.CONNECTION_SUCCESSFUL, handleSuccessfulGroupConnection);
 		}
-		//   ^ v
-		private function handleSuccessfulGroupConnection(e:NetworkGroupEvent):void
-		{
-			if (e.groupName == "CORE-COMMUNICATIONS-PUBLICDB")
-			{
-				removeEventListener(NetworkGroupEvent.CONNECTION_SUCCESSFUL, handleSuccessfulGroupConnection);
-				addEventListener(NetworkActionEvent.SUCCESS, handleSuccessfulStreamConnection);
-				publicDataI = new NetStream(_netConnection, pdsGspec.groupspecWithoutAuthorizations());
-				publicDataO = new NetStream(_netConnection, pdsGspec.groupspecWithoutAuthorizations());
-			}
-		}
-
-		private function handleSuccessfulStreamConnection(e:NetworkActionEvent):void
-		{
-			if (e.info == publicDataI)
-			{
-				publicDataIConnected = true;
-				publicDataI.play("stream");
-			}
-			else if (e.info = publicDataO)
-			{
-				publicDataOConnected = true;
-				publicDataO.publish("stream");
-			}
-
-			if (publicDataIConnected && publicDataOConnected)
-			{
-				removeEventListener(NetworkActionEvent.SUCCESS, handleSuccessfulStreamConnection);
-
-				//Get updated db | own format
-				//Accuracy of records may vary by second depending on broadcast speed vs object get. Might need a few guiders/supervisors who will have dominant say
-
-			}
-		}
-
+		//   ^

 		private function handleMysqlConnection(e:Event):void
@@ -467,6 +441,11 @@
 			return _netConnection;
 		}

+		public function get databaseService():DatabaseService
+		{
+			return _databaseService;
+		}
+
 		public function nameChange(name:String):void
 		{
 			nameChangeRequest = name;


Transferred from the Adobe Open Source Subversion Repository

Revision: 11095
Author:   eitan@ascender.com
Date:     2009-10-22T23:34:03.596935Z

Log Message:
-----------
Added changes in spark components to use AccImpl.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -149,6 +149,9 @@
  *  @productversion Flex 4
  */
 [Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark")]
+
+[AccessibilityClass(implementation="spark.accessibility.SkinnableTextBaseAccImpl")]
+

 /**
  *  The base class for skinnable components, such as the Spark TextInput
@@ -164,6 +167,18 @@
     implements IFocusManagerComponent, IIMESupport
 {
     include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by ListBaseAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;

     //--------------------------------------------------------------------------
     //
@@ -777,7 +792,17 @@
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-
+
+    /**
+     *  @private
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (SkinnableTextBase.createAccessibilityImplementation != null)
+            SkinnableTextBase.createAccessibilityImplementation(this);
+    }
+
+
     /**
      *  @private
      */


Added SELECTION_CHANGED to payloadEvent

Added SELECTION_CHANGED to payloadEvent

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

--- src/laml/events/PayloadEvent.as
+++ src/laml/events/PayloadEvent.as
@@ -8,6 +8,7 @@
 		public static const ERROR:String 				= 'error';
 		public static const LOADING_COMPLETED:String 	= 'loadingCompleted';
 		public static const REMOVED:String 				= 'removed';
+		public static const SELECTION_CHANGED:String	= 'selectionChanged';

 		public var payload:Object;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPAttribute.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPAttribute.as
@@ -0,0 +1,486 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.olap
+{
+import flash.utils.Dictionary;
+
+import mx.collections.IList;
+import mx.collections.ArrayCollection;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="levels", kind="property")]
+[Exclude(name="elements", kind="property")]
+
+/**
+ *  The OLAPAttribute class represents a single attribute of an OLAPDimension.
+ *  Use this class to associate a field of the flat data that is used to populate
+ *  an OLAP cube with a level of the dimension.
+ *
+ *  @mxml
+ *

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

+ *

+ *  <mx:OLAPAttribute
+ *    Properties
+ *    dataField=""
+ *  />
+ *.
+ *  @see mx.olap.OLAPDimension
+ *  @see mx.olap.OLAPLevel
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPAttribute extends OLAPHierarchy implements IOLAPAttribute
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param name The name of the OLAPAttribute instance.
+     *  You use this parameter to associate the OLAPAttribute instance with an OLAPLevel instance.
+     *
+     *  @param displayName The name of the attribute, as a String, which can be used for display.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function OLAPAttribute(name:String = null, displayName:String=null)
+    {
+        super(name, displayName);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    private var uniqueChildrenMap:Dictionary = new Dictionary(true);
+
+    private var uniqueMembers:IList = new ArrayCollection;
+
+    private var singleLevel:OLAPLevel;
+
+    mx_internal var userDataFunction:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // allLevels
+    //----------------------------------
+
+    /**
+     * @private
+     */
+    override mx_internal function get allLevels():IList
+    {
+        return new ArrayCollection([allLevel, singleLevel]);
+    }
+
+    //----------------------------------
+    // hasAll
+    //----------------------------------
+
+    /**
+     *  Contains true becasue attributes are assumed to be aggregatable
+     *  and all member is present.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function get hasAll():Boolean
+    {
+        //can this flag be false?
+        //if the attribute is not aggregatable this can be false
+        //but we are not supporting this as of now
+        return true;
+    }
+
+    //----------------------------------
+    // members
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function get members():IList
+    {
+        //TODO ***** we need to send the all member here.
+        var temp:ArrayCollection = new ArrayCollection(uniqueMembers.toArray());
+        temp.addItemAt(super.findMember(allMemberName), 0);
+
+        return temp;
+    }
+
+    //----------------------------------
+    // children
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get children():IList
+    {
+        return uniqueMembers;
+    }
+
+    //----------------------------------
+    // levels
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set levels(value:IList):void
+    {
+        // attribute doesn't allow setting up of levels by users
+        // it has its own level creation logic
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // userHierarchy
+    //----------------------------------
+
+    private var _userHierarchy:IOLAPHierarchy;
+
+    mx_internal function get userHierarchy():IOLAPHierarchy
+    {
+        return _userHierarchy;
+    }
+
+    mx_internal function set userHierarchy(value:IOLAPHierarchy):void
+    {
+        _userHierarchy = value;
+    }
+
+    //----------------------------------
+    // userHierarchyLevel
+    //----------------------------------
+
+    private var _userHierarchyLevel:OLAPLevel;
+
+    mx_internal function get userHierarchyLevel():OLAPLevel
+    {
+        return _userHierarchyLevel;
+    }
+
+    mx_internal function set userHierarchyLevel(value:OLAPLevel):void
+    {
+        _userHierarchyLevel = value;
+    }
+
+    //----------------------------------
+    // dataField
+    //----------------------------------
+
+    private var _dataField:String;
+
+    /**
+     *  The field of the input data set that provides the data for
+     *  this OLAPAttribute instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function set dataField(value:String):void
+    {
+        _dataField = value;
+    }
+
+    /**
+     * @private
+     */
+    public function get dataField():String
+    {
+        return _dataField;
+    }
+
+    //----------------------------------
+    // dataFunction
+    //----------------------------------
+
+    /**
+     * @private
+     */
+    protected var _dataFunction:Function = internalDataFunction;
+
+    /**
+    *  A callback function that returns the actual data for the attribute.
+    *  Use this callback function to return computed data based on the
+    *  actual data. For example, you can return the month name as a String
+    *  from actual date that represents the month as a number.
+    *  Or, you can calculate a value.
+    *  For example, your input data contains the ages of people,
+    *  such as 1, 4, 9, 10, 12, 15, or 20.
+    *  Your callback function can return an age group
+    *  that contains the age, as in 1-10, or 11-20.
+    *
+    *
The signature of the callback function is:

+    *
+    *

+    *      function myDataFunction(rowData:Object, dataField:String):Object;

+    *
+    *  where rowData contains the data for the row of
+    *  the input flat data, and dataField contains
+    *  the name of the data field.
+    *
+    *
The function can return a String or a Number.

+    *
+    *
The following example returns the age group for each age value
+    *  in the flat data:

+    *
+    *

+    *      private function ageGroupingHandler(rowData:Object, field:String):Object
+    *      {
+    *          return rowData[field] / 10;
+    *      }

+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    public function get dataFunction():Function
+    {
+        return _dataFunction;
+    }
+
+    public function set dataFunction(value:Function):void
+    {
+        if (value != null)
+        {
+            _dataFunction = value;
+            userDataFunction = true;
+        }
+        else
+        {
+            _dataFunction = internalDataFunction;
+            userDataFunction = false;
+        }
+    }
+
+    /**
+     *  User supplied callback function that would be used to compare
+     *  the data elements while sorting the data. By default the data
+     *  members would be compared directly.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var dataCompareFunction:Function = internalDataCompareFunction;
+
+    /**
+     *  A callback function that returns the display name of a member element.
+     *  Flex calls this function for each member added
+     *  to the OLAPAttribute instance.
+     *
+     *
The function signature is:

+     *
+     *

+     *      function myDisplayNameFunction(memberName:String):String

+     *
+     *
where memberName contains the name of the element.

+     *
+     *
The function returns the display name of the element.

+     *
+     *
The following example converts a numeric group name, such as 1,2, or 3
+     *  into display names "0-9", "10-19":

+     *
+     *

+     *      private function myDispFunction(name:String):String
+     *      {
+     *          var value:int = parseInt(name);
+     *          return String((value)*10 + " - ") + String((value+1)*10-1);
+     *      }

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var displayNameFunction:Function;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+    override public function findLevel(name:String):IOLAPLevel
+    {
+        return null;
+    }
+
+
+    override mx_internal function processData(data:Object):void
+    {
+        var name:String = dataFunction(data, dataField);
+        if (!uniqueChildrenMap[name])
+        {
+            var m:IOLAPMember = singleLevel.createMember(allMember, name);
+
+            if (displayNameFunction != null)
+                OLAPMember(m).displayName = displayNameFunction(name);
+            uniqueChildrenMap[m.name] = m;
+            uniqueMembers.addItem(m);
+        }
+    }
+
+    /**
+     * @private
+     */
+    override mx_internal function refresh():void
+    {
+    	uniqueChildrenMap = new Dictionary(true);
+    	uniqueMembers = new ArrayCollection();
+
+        if (!super.findLevel(name))
+        {
+            createAllLevelIfRequired();
+
+            singleLevel = createLevel(name);
+
+            OLAPLevel(allLevel).refresh();
+            singleLevel.refresh();
+
+            if (userHierarchyLevel)
+            {
+                if (userHierarchyLevel.depth == 1)
+                    OLAPAttributeLevel(allLevel).userLevel = OLAPHierarchy(userHierarchy).allLevel;
+                OLAPAttributeLevel(singleLevel).userLevel = userHierarchyLevel;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function createAllLevelIfRequired():void
+    {
+        var level:OLAPLevel;
+        if (hasAll)
+        {
+            //check if we don't have all level and member
+            // if we don't have create them
+            level = _levelMap[allLevelName];
+            if (!level)
+            {
+                //level = createLevel(allLevelName);
+                level = new OLAPAttributeLevel(allLevelName);
+                level.hierarchy = this;
+                level.dimension = dimension;
+                level.attributeName = name;
+                allLevel = level;
+                allMember = level.createMember(null, allMemberName) as OLAPMember;
+                allMember.setIsAll(true);
+            }
+        }
+        else
+        {
+            allLevel = null;
+            allMember = null;
+            level = _levelMap[allLevelName];
+            if (level)
+            {
+                var index:int = _levels.getItemIndex(level);
+                if (index > -1)
+                    _levels.removeItemAt(index);
+                delete _levelMap[allLevelName];
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function createLevel(name:String):OLAPLevel
+    {
+        var l:OLAPAttributeLevel = new OLAPAttributeLevel(name);
+        l.hierarchy = this;
+        l.dimension = dimension;
+        l.attributeName = name;
+        _levels.addItem(l);
+        _levelMap[name] = l;
+
+        return l;
+    }
+
+    /**
+     *  @private
+     */
+    private function internalDataFunction(rowData:Object, dataField:String):Object
+    {
+        return rowData[dataField];
+    }
+
+    /**
+     *  @private
+     */
+    private function internalDataCompareFunction(data1:Object, data2:Object):int
+    {
+        var value1:Object = internalDataFunction(data1, dataField);
+        var value2:Object = internalDataFunction(data2, dataField);
+
+        if (value1 < value2)
+            return -1;
+        if (value1 > value2)
+            return 1;
+        return 0;
+
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19344
Author:   egeorgie@adobe.com
Date:     2010-12-14T00:38:13.222484Z

Log Message:
-----------
PARB changes for density scaling

- authorDensity -> applicationDPI, type changed to int
- DensityUtil not visible in the documentation anymore [ExcludeClass]
- DensityUtil. screenDPIToDeviceDensity() -> classifyDPI(), returns int now
- DensityUtil. getDensityScale() -> getDPIScale(), takes int now
- DeviceDensity enum -> DPIClassification enum
- ISystemManager.densityScale property has been removed.
- New property to Application -> runtimeDPI.

QE notes: can start writing automated tests now
Doc notes:
Bugs:
Reviewer: Alex, Glenn, Jason SJ,
Tests run: checkintest
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="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/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/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DeviceDensity.as" copyfrom-rev="19256" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DPIClassification.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/NavigationAngledButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.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/mobiletheme/src/spark/skins/mobile/ActionButtonSkin.as</path>
<path kind="file" action="D">/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/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderDataTip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/CheckBoxSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.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/frameworks/projects/mobiletheme/src/spark/skins/mobile/RadioButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/NavigationButtonSkin.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@1259096 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/core/DPIClassification.as
+++ frameworks/projects/framework/src/mx/core/DPIClassification.as
@@ -15,26 +15,26 @@
 /**
  *  An enum of the device screen density classess.
  *
- *  When working with density, Flex collapses similar DPIs into density classes.
+ *  When working with DPI, Flex collapses similar DPI values into DPI classes.
  *
- *  @see spark.components.Appliction#authorDensity
- *  @see mx.core.DensityUtil
+ *  @see spark.components.Application#applicationDPI
+ *  @see spark.components.Application#runtimeDPI
  */
-public final class DeviceDensity
+public final class DPIClassification
 {
     /**
      *  Density value for low-density devices.
      */
-    public static const PPI_160:String = "160ppi";
+    public static const DPI_160:int = 160;

     /**
      *  Density value for medium-density devices.
      */
-    public static const PPI_240:String = "240ppi";
+    public static const DPI_240:int = 240;

     /**
      *  Density value for high-density devices.
      */
-    public static const PPI_320:String = "320ppi";
+    public static const DPI_320:int = 320;
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9930
Author:   smgilson@adobe.com
Date:     2009-09-02T18:18:40.643031Z

Log Message:
-----------
Add ASDoc version tags to new or untagged classes

QE notes: -
Doc notes: -
Bugs: -
Reviewer: -
Tests run: - checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/mxml/IMXMLSupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IMarshalSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Bounce.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/DefaultTileListEffect.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/INavigatorContent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/DefaultListEffect.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Elastic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>

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

--- frameworks/projects/framework/src/mx/core/INavigatorContent.as
+++ frameworks/projects/framework/src/mx/core/INavigatorContent.as
@@ -16,14 +16,33 @@
 /**
  *  NavigatorContent is an IDeferredContentOwner with label and icon properties
  *  that dispatch notifications when those properties change
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public interface INavigatorContent extends IDeferredContentOwner, IToolTipManagerClient
 {
     [Bindable("labelChanged")]
-	function get label():String;
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    function get label():String;

     [Bindable("iconChanged")]
-	function get icon():Class;
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    function get icon():Class;
 }

 }


FLEX-35321 CAUSE: if the object isn't on stage when we'd normally set its initialized flag to true, we correctly skip this step, but we also need to set its updateCompletePendingFlag back to false, so that in case it's added to stage again it can work correctly, and have its initialized flag set to true as expected. This second step was skipped in the previous commit. This could be noticed, for example, in DataGrid, which would not show the renderers which it initially used in GridViewLayout.updateTypicalCellSizes(). SOLUTION: set the updateCompletePendingFlag to false even if the object isn't on stage anymore. NOTES: also removed unused imports and an unused local variable.

--- frameworks/projects/framework/src/mx/managers/LayoutManager.as
+++ frameworks/projects/framework/src/mx/managers/LayoutManager.as
@@ -19,14 +19,10 @@

 package mx.managers
 {
-import flash.display.DisplayObject;
-import flash.display.Sprite;
 import flash.display.Stage;
 import flash.events.Event;
 import flash.events.EventDispatcher;

-import mx.core.ILayoutElement;
-import mx.core.UIComponent;
 import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.DynamicEvent;
@@ -852,8 +848,9 @@
                         obj.initialized = true;
                     if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE))
                         obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
-                    obj.updateCompletePendingFlag = false;
                 }
+
+                obj.updateCompletePendingFlag = false;
                 obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
             }

@@ -930,7 +927,6 @@
 		var lastCurrentObject:ILayoutManagerClient = currentObject;

         var obj:ILayoutManagerClient;
-        var i:int = 0;
         var done:Boolean = false;
         var oldTargetLevel:int = targetLevel;

@@ -1104,8 +1100,9 @@

                         if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE))
                             obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
+                    }
+
                         obj.updateCompletePendingFlag = false;
-                    }
                     obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
                 }
             }