Transferred from the Adobe Open Source Subversion Repository

Revision: 17169
Author:   chiedozi@adobe.com
Date:     2010-08-03T19:06:37.348954Z

Log Message:
-----------
Added the ability to show and hide the action bar and tab bar in ViewNavigator and View
Added the ability for a navigator to swtich between overlay modes
Added tabBar and overlay support to SlideViewTransition
Added overlay support to default ViewNavigatorSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/IViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/SlideViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as
@@ -1,12 +1,17 @@
 package spark.components
 {
 import flash.events.Event;
+import flash.geom.Rectangle;

 import mx.core.ISelectableList;
 import mx.core.IVisualElement;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
+import mx.effects.IEffect;
+import mx.effects.Parallel;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
+import mx.events.EffectEvent;
 import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
 import mx.events.PropertyChangeEventKind;
@@ -14,7 +19,9 @@

 import spark.components.supportClasses.ViewHistoryData;
 import spark.components.supportClasses.ViewNavigatorSection;
+import spark.effects.Fade;
 import spark.effects.IViewTransition;
+import spark.effects.Move;
 import spark.events.IndexChangeEvent;
 import spark.layouts.supportClasses.LayoutBase;

@@ -27,25 +34,18 @@
 //--------------------------------------

 /**
- *  @inherit
+ *  @inheritDoc
  */
 [Event(name="changing", type="spark.events.IndexChangeEvent")]

 /**
- *  Dispatched when the IList has been updated in some way.
- *
- *  @eventType mx.events.CollectionEvent.COLLECTION_CHANGE
- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
+ *  @inheritDoc
  */
 [Event(name="collectionChange", type="mx.events.CollectionEvent")]

 // FIXME (chiedozi): Figure out valueCommit and change event pattern
 /**
- *
+ *  @inheritDoc
  */
 [Event(name="valueCommit", type="mx.events.FlexEvent")]

@@ -58,8 +58,8 @@
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [SkinState("portrait")]

@@ -68,8 +68,8 @@
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [SkinState("landscape")]

@@ -78,8 +78,8 @@
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [SkinState("portraitAndOverlay")]

@@ -88,8 +88,8 @@
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [SkinState("landscapeAndOverlay")]

@@ -115,6 +115,8 @@
     private static const POP_ACTION:int = 1;
     private static const CHANGE_SECTION_ACTION:int = 2;

+    protected static const VISIBILITY_ANIMATION_DURATION:Number = 250;
+
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -126,8 +128,8 @@
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function ViewNavigator()
     {
@@ -161,17 +163,52 @@
     // Variables
     //
     //--------------------------------------------------------------------------
-
-    /**
-     *
+
+    /**
+     *  @private
+     */
+    private var actionBarProps:Object;
+
+    /**
+     *  @private
+     */
+    private var tabBarProps:Object;
+
+    /**
+     *  @private
+     */
+    private var contentGroupProps:Object;
+
+    /**
+     *  @private
+     */
+    private var animateActionBarVisbility:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var animateTabBarVisbility:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var actionBarVisibilityInvalidated:Boolean = false;
+
+    /**
+     *  @private
      */
     private var currentViewData:ViewHistoryData = null;

     /**
-     *
+     *  @private
      */
     private var currentViewChanged:Boolean = false;

+	/**
+     *  @private
+	 */
+	private var currentAnimation:IEffect;
+
     /**
      * @private
      * This following property stores the mouseEnabled
@@ -189,34 +226,72 @@
     private var explicitMouseChildren:Boolean;

     /**
-     *
+     *  @private
      */
     protected var lastAction:int = NO_ACTION;

     /**
-     *
+     *  @private
      */
     private var pendingViewData:ViewHistoryData = null;

     /**
-     *
+     *  @private
      */
     private var pendingViewTransition:IViewTransition = null;

     /**
      *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     private var revalidateWhenComplete:Boolean = false;

     /**
      *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     private var selectedSectionChanged:Boolean = false;

     //----------------------------------
+    //  actionBarPropertyInvalidated
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	protected function get actionBarPropertyInvalidated():Boolean
+	{
+		return 	actionContentInvalidated ||
+				actionGroupLayoutInvalidated ||
+				navigationContentInvalidated ||
+				navigationGroupLayoutInvalidated ||
+				titleInvalidated ||
+				titleContentInvalidated ||
+				titleGroupLayoutInvalidated;
+	}
+
+    //----------------------------------
     //  selectedSection
     //----------------------------------

+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     mx_internal function get selectedSection():ViewNavigatorSection
     {
         if (selectedIndex == -1)
@@ -244,6 +319,23 @@
         return currentSection.length;
     }

+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    private var tabBarVisibilityInvalidated:Boolean = false;
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     private var viewChanging:Boolean = false;

     //--------------------------------------------------------------------------
@@ -256,6 +348,16 @@
     //  activeView
     //----------------------------------

+    /**
+     *  The currently selected section.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public function get activeView():View
     {
         if (currentViewData)
@@ -271,6 +373,8 @@
     /**
      *  The currently selected section.
      *
+     *  @default null
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
@@ -302,22 +406,34 @@
         return _sections.length;
     }

-    private var _overlayMode:String;
-
-    public function get overlayMode():String
-    {
-        return _overlayMode;
-    }
-
-    public function set overlayMode(value:String):void
-    {
-        if (value != _overlayMode)
-        {
-            _overlayMode = value;
+    //----------------------------------
+    //  overlayControls
+    //----------------------------------
+    private var _overlayControls:Boolean = false;
+
+    /**
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get overlayControls():Boolean
+    {
+        return _overlayControls;
+    }
+
+    public function set overlayControls(value:Boolean):void
+    {
+        if (value != _overlayControls)
+        {
+            _overlayControls = value;
             invalidateSkinState();
         }
     }
-
+
     //----------------------------------
     //  sections
     //----------------------------------
@@ -332,9 +448,9 @@
      *  @default null
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get sections():Vector.<ViewNavigatorSection>
     {
@@ -363,7 +479,7 @@
 		internalDispatchEvent(CollectionEventKind.RESET);

 		if (tabBar)
-			tabBar.visible = tabBar.includeInLayout = (_sections != null && _sections.length > 1);
+			tabBar.visible = tabBar.includeInLayout = (_sections && _sections.length > 1);

 		// Changing the section always forces a validation to happened immediately
 		if (initialized)
@@ -391,6 +507,7 @@

     [Bindable("change")]
     [Bindable("valueCommit")]
+
     /**
      *  @inheritDoc
      */
@@ -444,49 +561,69 @@
         else
             invalidateProperties();
     }
-
-    //----------------------------------
-    //  transitionsEnabled
-    //----------------------------------
-    private var _transitionsEnabled:Boolean = true;
-
-    public function get transitionsEnabled():Boolean
-    {
-        return _transitionsEnabled;
-    }
-
-    /**
-     *  @private
-     */
-    public function set transitionsEnabled(value:Boolean):void
-    {
-        _transitionsEnabled = value;
-    }
-
-    //----------------------------------
-    //  useDefaultTransitions
-    //----------------------------------
-    private var _useDefaultTransitions:Boolean = true;
-
-    public function get useDefaultTransitions():Boolean
-    {
-        return _useDefaultTransitions;
-    }
-
-    /**
-     *  @private
-     */
-    public function set useDefaultTransitions(value:Boolean):void
-    {
-        _useDefaultTransitions = value;
-    }
+
+	//----------------------------------
+	//  transitionsEnabled
+	//----------------------------------
+	private var _transitionsEnabled:Boolean = true;
+
+    /**
+     *  Flag indicating whether transitions are played by the
+     *  navigator when a view changes or when the actionBar or tab bar
+     *  visibility changes.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    [Bindable]
+	public function get transitionsEnabled():Boolean
+	{
+		return _transitionsEnabled;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set transitionsEnabled(value:Boolean):void
+	{
+		_transitionsEnabled = value;
+	}
+
+	//----------------------------------
+	//  useDefaultTransitions
+	//----------------------------------
+	private var _useDefaultTransitions:Boolean = true;
+
+	public function get useDefaultTransitions():Boolean
+	{
+		return _useDefaultTransitions;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set useDefaultTransitions(value:Boolean):void
+	{
+		_useDefaultTransitions = value;
+	}

     //--------------------------------------------------------------------------
     //
     // Public Methods
     //
     //--------------------------------------------------------------------------
-
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public function popAll(transition:IViewTransition = null):void
     {
         if (currentSection.length == 0 || !canRemoveCurrentView())
@@ -511,6 +648,13 @@
         }
     }

+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public function popView(transition:IViewTransition = null):void
     {
         if (currentSection.length == 0 || !canRemoveCurrentView())
@@ -535,6 +679,13 @@
         }
     }

+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public function popToFirstView(transition:IViewTransition = null):void
     {
         if (currentSection.length < 2 || !canRemoveCurrentView())
@@ -559,6 +710,13 @@
         }
     }

+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     public function pushView(viewFactory:Class,
                              initializationData:Object = null,
                              transition:IViewTransition = null):void
@@ -585,7 +743,91 @@
             invalidateProperties();
         }
     }
-
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	public function showActionBar(animate:Boolean = true):void
+	{
+		if (actionBar && !actionBar.visible)
+		{
+			animateActionBarVisbility = animate;
+			actionBarVisibilityInvalidated = true;
+			invalidateProperties();
+		}
+		else
+		{
+			actionBarVisibilityInvalidated = false;
+		}
+	}
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	public function hideActionBar(animate:Boolean = true):void
+	{
+		if (actionBar && actionBar.visible)
+		{
+			animateActionBarVisbility = animate;
+			actionBarVisibilityInvalidated = true;
+			invalidateProperties();
+		}
+		else
+		{
+			actionBarVisibilityInvalidated = false;
+		}
+	}
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	public function showTabBar(animate:Boolean = true):void
+	{
+		if (tabBar && sections.length > 1 && !tabBar.visible)
+		{
+			animateTabBarVisbility = animate;
+			tabBarVisibilityInvalidated = true;
+			invalidateProperties();
+		}
+		else
+		{
+			tabBarVisibilityInvalidated = false;
+		}
+	}
+
+    /**
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	public function hideTabBar(animate:Boolean = true):void
+	{
+		if (tabBar && tabBar.visible)
+		{
+			animateTabBarVisbility = animate;
+			tabBarVisibilityInvalidated = true;
+			invalidateProperties();
+		}
+		else
+		{
+			tabBarVisibilityInvalidated = false;
+		}
+	}
+
     //--------------------------------------------------------------------------
     //
     //  UI Template Properties
@@ -696,6 +938,9 @@
     //  navigationGroupLayout
     //----------------------------------

+    private var _navigationGroupLayout:LayoutBase;
+    private var navigationGroupLayoutInvalidated:Boolean = false;
+
     /**
      *  Layout for the ActionBar navigation content group.
      *
@@ -706,9 +951,6 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    private var _navigationGroupLayout:LayoutBase;
-    private var navigationGroupLayoutInvalidated:Boolean = false;
-
     public function get navigationGroupLayout():LayoutBase
     {
         return _navigationGroupLayout;
@@ -792,6 +1034,9 @@
     //  titleGroupLayout
     //----------------------------------

+    private var _titleGroupLayout:LayoutBase;
+    private var titleGroupLayoutInvalidated:Boolean = false;
+
     /**
      *  Layout for the ActionBar's titleContent group.
      *
@@ -802,9 +1047,6 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    private var _titleGroupLayout:LayoutBase;
-    private var titleGroupLayoutInvalidated:Boolean = false;
-
     public function get titleGroupLayout():LayoutBase
     {
         return _titleGroupLayout;
@@ -825,7 +1067,15 @@
     // Private Methods
     //
     //--------------------------------------------------------------------------
-
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     protected function beginViewChange():void
     {
         viewChanging = true;
@@ -838,10 +1088,17 @@
     }

     /**
+     *  @private
+     *
      *  This method checks if the current view can be removed
      *  from the display list.
      *
      *  @return Returns true if the screen can be removed
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     protected function canRemoveCurrentView():Boolean
     {
@@ -854,16 +1111,46 @@
         return (view == null || view.canRemove);
     }

+    /**
+     *  @private
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    private function clearActionBarInvalidationFlags():void
+    {
+        actionContentInvalidated = false;
+        actionGroupLayoutInvalidated = false;
+        navigationContentInvalidated = false;
+        navigationGroupLayoutInvalidated = false;
+        titleInvalidated = false;
+        titleContentInvalidated = false;
+        titleGroupLayoutInvalidated = false;
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     override protected function commitProperties():void
     {
+        super.commitProperties();
+
         // If the sections property is not set by this point, ViewNavigator will
         // create a default section to be used by the navigator, and initialize it
-        // with the firstView and firstViewData defined by the application
+        // with the firstView and its data defined by the application
         if (sections == null || sections.length == 0)
         {
-            // TODO: ViewNavigator should have a firstView and rootData convenience property
             // Create the empty screen stack and initialize it with the
-            // desired firstView and initial data
+            // desired firstView and its data
             var section:ViewNavigatorSection = new ViewNavigatorSection();
             section.firstView = null;
             section.firstViewData = null;
@@ -872,15 +1159,69 @@
             var newSections:Vector.<ViewNavigatorSection> = Vector.<ViewNavigatorSection>([section]);
             sections = newSections;
         }
-
+
         if (currentViewChanged)
             executeViewChange();
+
+		if (actionBarPropertyInvalidated)
+        	updateActionBarProperties(activeView);
+
+		if (actionBarVisibilityInvalidated || tabBarVisibilityInvalidated)
+            commitVisibilityChanges();
+    }
+
+    // TODO (chiedozi): Check if spark effects handles include in layout for you
+    /**
+     *  @private
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function commitVisibilityChanges():void
+    {
+        // Can't change the visibility during a view transition
+        if (viewChanging)
+        {
+            actionBarVisibilityInvalidated = false;
+            tabBarVisibilityInvalidated = false;
+            return;
+        }
+
+        // If an animation is running, end it
+        if (currentAnimation)
+            currentAnimation.end();
+
+        if (transitionsEnabled && (animateActionBarVisbility || animateTabBarVisbility))
+        {
+            currentAnimation = createVisibilityAnimation();
+            currentAnimation.addEventListener(EffectEvent.EFFECT_END, visibilityAnimation_completeHandler);
+            currentAnimation.play();
+        }
         else
-            updateActionBarProperties(activeView);
-
-        super.commitProperties();
-    }
-
+        {
+            if (actionBarVisibilityInvalidated)
+                actionBar.visible = actionBar.includeInLayout = !actionBar.visible;
+
+            if (tabBarVisibilityInvalidated)
+                tabBar.visible = tabBar.includeInLayout = !tabBar.visible;
+
+            actionBarVisibilityInvalidated = false;
+            tabBarVisibilityInvalidated = false;
+        }
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     protected function commitSelection():Boolean
     {
         _selectedIndex = _proposedSelectedIndex;
@@ -895,8 +1236,246 @@

         pendingViewTransition = null;
         return true;
-    }
-
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	protected function createVisibilityAnimation():IEffect
+	{
+		var effect:IEffect;
+		var finalEffect:Parallel = new Parallel();
+
+        // Grab initial values
+		actionBarProps = { start:captureAnimationValues(actionBar) };
+        tabBarProps = { start:captureAnimationValues(tabBar) };
+        contentGroupProps = { start:captureAnimationValues(contentGroup) };
+
+        // Update actionBar layout properties
+        if (actionBarVisibilityInvalidated)
+            actionBar.visible = actionBar.includeInLayout = !actionBarProps.start.visible;
+
+        if (tabBarVisibilityInvalidated)
+            tabBar.visible = tabBar.includeInLayout = !tabBarProps.start.visible;
+
+        // Calculate final positions.  This method will force a validation
+        calculateFinalUIPositions();
+
+        // The actionbar will be visible if we are animating it
+		if (actionBar.visible)
+		{
+            effect = createActionBarVisibilityEffect(actionBar.visible, actionBarProps);
+            effect.target = actionBar;
+
+            finalEffect.addChild(effect);
+		}
+
+        // The tab bar will only be animated if it is visible
+		if (tabBar.visible)
+		{
+            effect = createTabBarVisibilityEffect(tabBar.visible, tabBarProps);
+            effect.target = tabBar;
+
+            finalEffect.addChild(effect);
+		}
+
+		var moveEffect:Move = new Move();
+        moveEffect.target = contentGroup;
+        moveEffect.yFrom = contentGroupProps.start.y;
+        moveEffect.yTo = contentGroup.y;
+		contentGroup.includeInLayout = false;
+		contentGroup.cacheAsBitmap = true;
+		finalEffect.addChild(moveEffect);
+
+		finalEffect.duration = VISIBILITY_ANIMATION_DURATION;
+		return finalEffect;
+	}
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function calculateFinalUIPositions():void
+    {
+        var animateActionBarUp:Boolean;
+        var animateTabBarUp:Boolean;
+
+        if (overlayControls)
+        {
+            animateActionBarUp = actionBar.y <= height / 2;
+            animateTabBarUp = tabBar.y <= height / 2;
+        }
+        else
+        {
+            animateActionBarUp = actionBar.y <= contentGroup.y;
+            animateTabBarUp = tabBar.y <= contentGroup.y;
+        }
+
+        // Need to validate to capture final positions and sizes of skin parts
+        validateNow();
+
+        // This will store the final location and sizes of the components
+        actionBarProps.end = captureAnimationValues(actionBar);
+        tabBarProps.end = captureAnimationValues(tabBar);
+        contentGroupProps.end = captureAnimationValues(contentGroup);
+
+        if (actionBarVisibilityInvalidated)
+        {
+            if (animateActionBarUp)
+            {
+                if (actionBarProps.start.visible)
+                    actionBarProps.end.y = -actionBar.height;
+                else
+                    actionBarProps.start.y = -actionBar.height;
+            }
+            else
+            {
+                if (actionBarProps.start.visible)
+                    actionBarProps.end.y = this.height;
+                else
+                    actionBarProps.start.y = this.height;
+            }
+
+            actionBar.visible = true;
+        }
+
+        if (tabBarVisibilityInvalidated)
+        {
+            if (animateTabBarUp)
+            {
+                if (tabBarProps.start.visible)
+                    tabBarProps.end.y = -tabBar.height;
+                else
+                    tabBarProps.start.y = -tabBar.height;
+            }
+            else
+            {
+                if (tabBarProps.start.visible)
+                    tabBarProps.end.y = this.height;
+                else
+                    tabBarProps.start.y = this.height;
+            }
+
+            tabBar.visible = true;
+        }
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function captureAnimationValues(component:UIComponent):Object
+    {
+        var values:Object = {   y:component.y,
+                                visible: component.visible,
+                                includeInLayout: component.includeInLayout,
+                                cacheAsBitmap: component.cacheAsBitmap };
+
+        return values;
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function createActionBarVisibilityEffect(hiding:Boolean, props:Object):IEffect
+    {
+        var effect:Move = new Move();
+
+        effect.target = actionBar;
+        effect.yFrom = props.start.y;
+        effect.yTo = props.end.y;
+
+        actionBar.includeInLayout = false;
+        actionBar.cacheAsBitmap = true;
+
+        return effect;
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function createTabBarVisibilityEffect(hiding:Boolean, props:Object):IEffect
+    {
+        var effect:Move = new Move();
+        effect.target = tabBar;
+        effect.yFrom = props.start.y;
+        effect.yTo = props.end.y;
+
+        tabBar.includeInLayout = false;
+        tabBar.cacheAsBitmap = true;
+
+        return effect;
+    }
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+	private function visibilityAnimation_completeHandler(event:EffectEvent):void
+	{
+		event.target.removeEventListener(EffectEvent.EFFECT_END, visibilityAnimation_completeHandler);
+
+		if (actionBarVisibilityInvalidated)
+			actionBar.visible = actionBar.includeInLayout = !actionBarProps.start.visible;
+		else
+			actionBar.includeInLayout = actionBarProps.start.includeInLayout;
+
+		if (tabBarVisibilityInvalidated)
+			tabBar.visible = tabBar.includeInLayout = !tabBarProps.start.visible;
+		else
+			tabBar.includeInLayout = tabBarProps.start.includeInLayout;
+
+        // Restore includeInLayout and cacheAsBitmap properties for each component
+		contentGroup.includeInLayout = contentGroupProps.start.includeInLayout;
+
+		actionBar.cacheAsBitmap = actionBarProps.start.cacheAsBitmap;
+		tabBar.cacheAsBitmap = tabBarProps.start.cacheAsBitmap;
+		contentGroup.cacheAsBitmap = contentGroupProps.start.cacheAsBitmap;
+
+		currentAnimation = null;
+		actionBarProps = null;
+		contentGroupProps = null;
+		tabBarProps = null;
+
+		actionBarVisibilityInvalidated = false;
+		tabBarVisibilityInvalidated = false;
+	}
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     protected function endViewChange():void
     {
         var currentView:View;
@@ -911,7 +1490,7 @@

             // FIXME (chiedozi): Figure out how to use focus manager to manage focus
             // when a component in the current view has focus.
-            stage.focus = null;
+			stage.focus = null;

             // Grab the data from the old view and persist it
             if (lastAction == PUSH_ACTION || lastAction == CHANGE_SECTION_ACTION)
@@ -933,6 +1512,12 @@
         currentViewData = pendingViewData;
         pendingViewData = null;

+        // Clear all property invalidation flags
+        actionBarVisibilityInvalidated = false;
+        tabBarVisibilityInvalidated = false;
+
+        clearActionBarInvalidationFlags();
+
         if (currentViewData)
         {
             currentView = currentViewData.instance;
@@ -967,11 +1552,23 @@
             dispatchEvent(new Event(Event.COMPLETE));
     }

+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
     protected function executeViewChange():void
     {
         // Private event used for performance tests
         if (hasEventListener("viewChangeStart"))
             dispatchEvent(new Event("viewChangeStart"));
+
+        // If a ui control is animating, force it to end
+        if (currentAnimation)
+            currentAnimation.end();

         if (selectedSectionChanged)
         {
@@ -1091,6 +1688,16 @@
         if (actionBar)
             updateActionBarProperties(pendingView, true);

+		// Update tabBar visibility
+		if (tabBar && sections.length > 1 && pendingView)
+			tabBar.visible = tabBar.includeInLayout = pendingView.showTabBar;
+
+        if (pendingView.overlayControls != overlayControls)
+        {
+            overlayControls = pendingView.overlayControls;
+            validateProperties();
+        }
+
         // Need to validate my children now to prevent flicker when no transition,
         // or so sizes can be measured before transition
         validateNow();
@@ -1112,7 +1719,7 @@

     override protected function getCurrentSkinState():String
     {
-        return null;
+        return (_overlayControls) ? "portraitAndOverlay" : "portrait";
     }

     protected function transitionComplete(event:Event):void
@@ -1128,7 +1735,7 @@

     protected function updateActionBarProperties(view:View, forceUpdate:Boolean = false):void
     {
-        if (!actionBar)
+        if (!actionBar || !view)
             return;

         // If there is no view, update the actionBar should display the
@@ -1152,14 +1759,9 @@
             actionBar.title = view && view.title ? view.title : title;
             actionBar.titleContent = view && view.titleContent ? view.titleContent : titleContent;
             actionBar.titleLayout = view && view.titleGroupLayout ? view.titleGroupLayout : titleGroupLayout;
-
-            actionContentInvalidated = false;
-            actionGroupLayoutInvalidated = false;
-            navigationContentInvalidated = false;
-            navigationGroupLayoutInvalidated = false;
-            titleInvalidated = false;
-            titleContentInvalidated = false;
-            titleGroupLayoutInvalidated = false;
+			actionBar.visible = actionBar.includeInLayout = view && view.showActionBar;
+
+            clearActionBarInvalidationFlags();
         }
         else
         {
@@ -1209,7 +1811,9 @@
                 actionBar.titleLayout = view && view.titleGroupLayout ?
                     view.titleGroupLayout : titleGroupLayout;
                 titleGroupLayoutInvalidated = false;
-            }
+            }
+
+			actionBar.visible = actionBar.includeInLayout = view && view.showActionBar;
         }
     }

@@ -1248,8 +1852,11 @@
         super.partAdded(partName, instance);

         // Tab bar should only be visible only if there is more than 1 section
-        if (instance == tabBar && sections)
-            tabBar.visible = tabBar.includeInLayout = sections.length > 1;
+        if (instance == tabBar)
+        {
+            tabBar.dataProvider = this;
+            tabBar.visible = tabBar.includeInLayout = (sections && sections.length > 1);
+        }

         // If the actionBar changes, need to reset the properties on it
         if (instance == actionBar)


Transferred from the Adobe Open Source Subversion Repository

Revision: 19410
Author:   jszeto@adobe.com
Date:     2010-12-15T23:14:11.037206Z

Log Message:
-----------
ViewMenu skin changes

Simplified the skins.

Up and ShowsCaret
- Removed top highlights
- Changed border from gradient to solid
- Removed bottom shadow

Down
- No longer inset by 1px
- Removed outer highlight border
- Removed two inner shadow borders
- Lightened outer shadow borders
- Darkened shadow fill
- Removed bottom highlight

ViewMenuSkin
- Added separators to top and bottom
- Darkened divider line
- Changed 160 DPI to 1px separators

QE notes: need baselines
Doc notes: none
Bugs: none
Reviewer: Jason San Jose
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuItemSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/ViewMenuItem_showsCaret.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/ViewMenuItem_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/ViewMenuItem_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/ViewMenuItem_showsCaret.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/ViewMenuItem_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/ViewMenuItem_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuSkin.mxml</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuItemSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuItemSkin.as
@@ -95,13 +95,13 @@
         else
         {
             matrix.createGradientBox(unscaledWidth,
-                                     unscaledHeight - layoutBorderSize,
+                                     unscaledHeight,
                                      Math.PI / 2, 0, 0);
             var chromeColor:uint = getStyle("chromeColor");

             chromeColorGraphics.beginGradientFill(GradientType.LINEAR,
                                                   [chromeColor, chromeColor],
-                                                  [0.85, .95],
+                                                  [0.9, 0.95],
                                                   [0, 255],
                                                   matrix);
         }
@@ -110,17 +110,7 @@
     override protected function drawChromeColor(chromeColorGraphics:Graphics,
                                                 unscaledWidth:Number, unscaledHeight:Number):void
     {
-        // bottom line is a shadow
-        if (currentState == "down")
-            chromeColorGraphics.drawRect(layoutBorderSize,
-                                         layoutBorderSize,
-                                         unscaledWidth - layoutBorderSize * 2,
-                                         unscaledHeight - layoutBorderSize * 2);
-        else
-            chromeColorGraphics.drawRect(0,
-                                         0,
-                                         unscaledWidth,
-                                         unscaledHeight - layoutBorderSize);
+            chromeColorGraphics.drawRect(0,0,unscaledWidth,unscaledHeight);
     }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3727
Author:   jszeto@adobe.com
Date:     2008-10-17T22:34:12.409079Z

Log Message:
-----------
Fix masking for GraphicElements

SDK-17337 Masking broken for GraphicElements

We no longer attach the mask to the GraphicElement's parent. Because the mask can not be a child of the maskee, we create a new drawnDisplayObject and attach it and the mask to the displayObject property.

QE Notes: None
Doc Notes: None
Bugs: SDK-17337
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/IGraphicElementHost.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as
@@ -790,22 +790,6 @@
         return null;
     }

-    /**
-     *  @inheritDoc
-     */
-    public function addMaskElement(mask:DisplayObject, target:IGraphicElement):void
-    {
-
-    }
-
-    /**
-     *  @inheritDoc
-     */
-    public function removeMaskElement(mask:DisplayObject, target:IGraphicElement):void
-    {
-
-    }
-
     /**
      *  Helper method to wrap up the changes in a PropertyChangeEvent event object,
      *  and dispatch the event.


JS side needed a kick to get top level object to begin its layout, just like its AS counterpart.

--- frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
+++ frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
@@ -584,7 +584,28 @@
             initialView.applicationModel = model;
             addElement(initialView);

-            dispatchEvent('viewChanged');
+            if (initialView)
+            {
+                initialView.applicationModel =  model;
+                // if someone has installed a resize listener, fake an event to run it now
+                if (initialView is ILayoutChild)
+                {
+                    var ilc:ILayoutChild = initialView as ILayoutChild;
+                    var useWidth:Number = document.width;
+                    var useHeight:Number = document.height;
+                    // otherwise, size once like this
+                    if (!isNaN(ilc.percentWidth) && !isNaN(ilc.percentHeight)) {
+                        ilc.setWidthAndHeight(useWidth, useHeight);
+                    }
+                    else if (!isNaN(ilc.percentWidth))
+                        ilc.setWidth(useWidth);
+                    else if (!isNaN(ilc.percentHeight))
+                        ilc.setHeight(useHeight);
+                }
+
+                dispatchEvent(new org.apache.flex.events.Event("viewChanged"));
+            }
+            dispatchEvent(new org.apache.flex.events.Event("applicationComplete"));
         };

     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 19912
Author:   tkraikit@adobe.com
Date:     2011-01-24T19:51:04.840700Z

Log Message:
-----------
ImageSkin for mobile.

Mobile Theme Skins spec: https://zerowing.corp.adobe.com/display/flexmobile/Mobile+Theme+Skins+Spec

XD spec for ImageSkin: https://zerowing.corp.adobe.com/display/xdplatform/Image+Indicator

QE notes: none
Doc notes: n/a
Bugs: n/a
Reviewer: Jason San Jose
Tests run: checkintests, mustella(cyclone)
Is noteworthy for integration: n/a

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/ImageInvalid.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/ImageInvalid.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/ImageInvalid.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ImageSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ImageSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ImageSkin.as
@@ -0,0 +1,387 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.skins.mobile
+{
+import flash.display.DisplayObject;
+import flash.display.Graphics;
+
+import mx.core.DPIClassification;
+
+import spark.components.BusyIndicator;
+import spark.components.Group;
+import spark.components.Image;
+import spark.primitives.BitmapImage;
+import spark.skins.mobile.supportClasses.MobileSkin;
+import spark.skins.mobile160.assets.ImageInvalid;
+import spark.skins.mobile240.assets.ImageInvalid;
+import spark.skins.mobile320.assets.ImageInvalid;
+
+/**
+ *  ActionScript-based skin for the Image component in mobile applications.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class ImageSkin extends MobileSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     *
+     */
+	public function ImageSkin()
+	{
+		super();
+
+        // set the right assets and dimensions to use based on the screen density
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_320:
+            {
+                imageInvalidClass = spark.skins.mobile320.assets.ImageInvalid;
+                placeholderImageWidth = 68;
+                placeholderImageHeight = 68;
+                break;
+            }
+            case DPIClassification.DPI_240:
+            {
+                imageInvalidClass = spark.skins.mobile240.assets.ImageInvalid;
+                placeholderImageWidth = 50;
+                placeholderImageHeight = 50;
+                break;
+            }
+            default:
+            {
+                // default PPI160
+                imageInvalidClass = spark.skins.mobile160.assets.ImageInvalid;
+                placeholderImageWidth = 34;
+                placeholderImageHeight = 34;
+                break;
+            }
+
+        }
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @copy spark.skins.spark.ApplicationSkin#hostComponent
+     */
+	public var hostComponent:Image;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin parts
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Image imageDisplay skin part that contains the image content
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var imageDisplay:BitmapImage;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Container of the BitmapImage to be displayed
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected var imageHolder:Group;
+
+    /**
+     *  The currently displayed asset: either the intended image,
+     *  the loading indicator, the "invalid image" icon, or null.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    private var currentImage:DisplayObject;
+
+    /**
+     *  Specifies the FXG class to use in the "invalid" image state
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected var imageInvalidClass:Class;
+
+    /**
+     *  Specifies the DisplayObject to use in the "invalid" image state
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    private var imageInvalid:DisplayObject;
+
+    /**
+     *  Displayed if the "enableLoadingState" style is true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected var loadingIndicator:BusyIndicator = null;
+
+    /**
+     *  Width of the placeholder images (i.e. "invalid image" icon
+     *  and loading indicator).
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected var placeholderImageWidth:int;
+
+    /**
+     *  Height of the placeholder images (i.e. "invalid image" icon
+     *  and loading indicator).
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected var placeholderImageHeight:int;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function commitCurrentState():void
+    {
+        var alphaValue:Number = 1.0;
+
+        if (currentState == "uninitialized")
+        {
+            if (imageInvalid)
+            {
+                removeChild(imageInvalid);
+                imageInvalid = null;
+            }
+
+            if (loadingIndicator)
+            {
+                removeChild(loadingIndicator);
+                loadingIndicator = null;
+            }
+
+            currentImage = null;
+        }
+        else if (currentState == "loading")
+        {
+            // turn off any other images
+            if (imageInvalid)
+            {
+                removeChild(imageInvalid);
+                imageInvalid = null;
+            }
+
+            if (!loadingIndicator)
+            {
+                loadingIndicator = new BusyIndicator();
+                setElementSize(loadingIndicator, placeholderImageWidth, placeholderImageHeight);
+                addChild(loadingIndicator);
+            }
+
+            currentImage = loadingIndicator;
+        }
+        else if (currentState == "ready")
+        {
+            if (imageInvalid)
+            {
+                removeChild(imageInvalid);
+                imageInvalid = null;
+            }
+
+            if (loadingIndicator)
+            {
+                removeChild(loadingIndicator);
+                loadingIndicator = null;
+            }
+
+            currentImage = imageHolder;
+        }
+        else if (currentState == "invalid")
+        {
+            if (loadingIndicator)
+            {
+                removeChild(loadingIndicator);
+                loadingIndicator = null;
+            }
+
+            if (!imageInvalid)
+            {
+                imageInvalid = new imageInvalidClass();
+                addChild(imageInvalid);
+            }
+
+            currentImage = imageInvalid;
+        }
+        else if (currentState == "disabled")
+        {
+            alphaValue = 0.5;
+
+            // remove any loading or invalid images
+            if (imageInvalid)
+            {
+                removeChild(imageInvalid);
+                imageInvalid = null;
+            }
+
+            if (loadingIndicator)
+            {
+                removeChild(loadingIndicator);
+                loadingIndicator = null;
+            }
+
+            currentImage = imageHolder;
+        }
+        else
+        {
+            // unexpected state; ignore
+        }
+
+        alpha = alphaValue;
+
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
+     */
+	override protected function createChildren():void
+    {
+        // create container for holding the currently displayed image
+        imageHolder = new Group();
+        addChild(imageHolder);
+
+        // required skin part; the Image component will set this directly
+        imageDisplay = new BitmapImage();
+        imageDisplay.left = 0;
+        imageDisplay.right = 0;
+        imageDisplay.top = 0;
+        imageDisplay.bottom = 0;
+
+        imageHolder.addElement(imageDisplay);
+	}
+
+    /**
+     *  @private
+     */
+	override protected function measure():void
+	{
+        super.measure();
+
+        if (currentImage)
+        {
+            measuredHeight = getElementPreferredHeight(currentImage);
+            measuredWidth = getElementPreferredWidth(currentImage);
+        }
+    }
+
+    /**
+     *  @private
+     */
+	override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+	{
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var preferredWidth:Number;
+        var preferredHeight:Number;
+
+        if (loadingIndicator && currentImage == loadingIndicator)
+        {
+            preferredWidth = loadingIndicator.getPreferredBoundsWidth();
+            preferredHeight = loadingIndicator.getPreferredBoundsHeight();
+
+            // loading indicator will be no bigger than its preferred width/height
+            setElementSize(loadingIndicator,
+                Math.min(unscaledWidth, preferredWidth),
+                Math.min(unscaledHeight, preferredHeight));
+
+            // center the loading indicator
+            setElementPosition(loadingIndicator,
+                Math.max((unscaledWidth - preferredWidth) / 2, 0),
+                Math.max((unscaledHeight - preferredHeight) / 2, 0));
+        }
+        else if (imageInvalid && currentImage == imageInvalid)
+        {
+            preferredWidth = getElementPreferredWidth(imageInvalid);
+            preferredHeight = getElementPreferredHeight(imageInvalid);
+
+            // icon shrinks with any explicit image size
+            setElementSize(imageInvalid,
+                Math.min(preferredWidth, unscaledWidth),
+                Math.min(preferredHeight, unscaledHeight));
+
+            // center the invalid image icon
+            setElementPosition(imageInvalid,
+                Math.max((unscaledWidth - preferredWidth) / 2, 0),
+                Math.max((unscaledHeight - preferredHeight) / 2, 0));
+        }
+        else if (currentImage == imageHolder)
+            setElementSize(imageHolder, unscaledWidth, unscaledHeight);
+
+        // set the background rect if specified
+        var g:Graphics = graphics;
+        g.clear();
+        if (!isNaN(getStyle("backgroundColor")))
+        {
+            g.beginFill(getStyle("backgroundColor"), getStyle("backgroundAlpha"));
+            g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+        }
+	}
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/containers/gridClasses/GridRowInfo.as
+++ frameworks/projects/mx/src/mx/containers/gridClasses/GridRowInfo.as
@@ -33,6 +33,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function GridRowInfo()
 	{
@@ -56,6 +61,11 @@

 	/**
 	 *  Input: Measurement for the GridRow.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var flex:Number;

@@ -66,6 +76,11 @@
 	/**
 	 *  Output: The actual height of each row,
 	 *  as determined by updateDisplayList().
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var height:Number;

@@ -75,6 +90,11 @@

 	/**
 	 *  Input: Measurement for the GridRow.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var max:Number;

@@ -84,6 +104,11 @@

 	/**
 	 *  Input: Measurement for the GridRow.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var min:Number;

@@ -93,6 +118,11 @@

 	/**
 	 *  Input: Measurement for the GridRow.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var preferred:Number;

@@ -103,6 +133,11 @@
 	/**
 	 *  Output: The actual position of each row,
 	 *  as determined by updateDisplayList().
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public var y:Number;
 }


FLEX-33665: Correcting the item editor positioning for datagrid.

--- frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/DataGridEditor.as
@@ -570,7 +570,7 @@

         _editedItemRenderer = item;

-       // Need to turn on focusable children flag so focus manager will
+        // Need to turn on focusable children flag so focus manager will
         // allow focus into the data grid's children.
         if (restoreFocusableChildren)
             saveDataGridHasFocusableChildren = dataGrid.hasFocusableChildren;
@@ -578,6 +578,10 @@

         if (dataGrid.scroller)
         {
+            //Correct the item edit positioning based on the scroll position.
+//            localCellOrigin.x -= grid.horizontalScrollPosition;
+//            localCellOrigin.y -= grid.verticalScrollPosition;
+
             if (restoreFocusableChildren)
                 saveScrollerHasFocusableChildren = dataGrid.scroller.hasFocusableChildren;
             dataGrid.scroller.hasFocusableChildren = true;


FLEX-22876.  Fix infinite loop in getContentHeight().

git-svn-id: f8d5f742b420a6a114b58659a4f85f335318e53c@1437209 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -1285,7 +1285,10 @@
         while (node && node.rowIndex < maxRow)
         {
             if (node.rowIndex < startRowIndex)
+            {
+                node = node.next;
                 continue;
+            }
             contentHeight += getRowHeight(node.rowIndex);
             numRows++;
             node = node.next;
@@ -1902,4 +1905,4 @@
         return rowList.toString();
     }
 }
-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 6212
Author:   gauravj@adobe.com
Date:     2009-04-23T15:49:01.656497Z

Log Message:
-----------
removing [ExcludeClass] from IXMLNotifiable.as

QE Notes: None.
Doc Notes: Please update the asdoc for the interface.
Bugs: SDK-18129
tests: checkintests

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/IXMLNotifiable.as

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

--- frameworks/projects/framework/src/mx/utils/IXMLNotifiable.as
+++ frameworks/projects/framework/src/mx/utils/IXMLNotifiable.as
@@ -12,10 +12,8 @@
 package mx.utils
 {

-[ExcludeClass]
-
 /**
- *  The IXMLNotifiable interface is for internal use only.
+ *  The IXMLNotifiable interface.
  *
  *  @langversion 3.0
  *  @playerversion Flash 9


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/mx/src/mx/events/ScrollEventDirection.as
+++ frameworks/projects/mx/src/mx/events/ScrollEventDirection.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2006 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.events
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19270
Author:   cframpto@adobe.com
Date:     2010-12-10T18:21:34.150045Z

Log Message:
-----------
Add mouseWheelChanging event to VScrollBar, HScrollBar and Scroller.  The event is dispatched before the mouseWheel event modifies the scroll position.  The event can be canceled to prevent the mouseWheel handler's default behavior or the event's delta can be modified and that value will be used by the mouseWheel handler when calculating the new scroll position.  In RichEditableText, when pasting, add null check before accessing the TextScrap.  There is a bug in one or more version of the player such that this can be null at times.

QE notes: Hans said we will do a PARB review by email for the new event
Doc notes:
Bugs: SDK-27106, SDK-26432
Reviewer: Hans (scroller), Darrell (RET)
Tests run: cyclone
Is noteworthy for integration: yes - new mouseWheelChanging event on VScrollBar, HScrollBar and Scroller

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexMouseEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/utils/MouseEventUtil.as</path>

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

--- frameworks/projects/spark/src/spark/components/HScrollBar.as
+++ frameworks/projects/spark/src/spark/components/HScrollBar.as
@@ -17,14 +17,44 @@
 import mx.core.EventPriority;
 import mx.core.IInvalidating;
 import mx.core.mx_internal;
+import mx.events.FlexMouseEvent;
 import mx.events.PropertyChangeEvent;
 import mx.events.ResizeEvent;

 import spark.components.supportClasses.ScrollBarBase;
 import spark.core.IViewport;
 import spark.core.NavigationUnit;
+import spark.utils.MouseEventUtil;

 use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the horizontalScrollPosition is going
+ *  to change due to a mouseWheel event.
+ *
+ *
The default behavior is to scroll horizontally by the event
+ *  delta number of "steps".
+ *  The viewport's getHorizontalScrollPositionDelta method using
+ *  either LEFT or RIGHT, depending on the scroll
+ *  direction, determines the width of the step.

+ *
+ *
Calling the preventDefault() method
+ *  on the event prevents the horizontal scroll position from changing.
+ *  Otherwise if you modify the delta property of the event,
+ *  that value will be used as the number horizontal of "steps".

+ *
+ *  @eventType mx.events.FlexMouseEvent.MOUSE_WHEEL_CHANGING
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Event(name="mouseWheelChanging", type="mx.events.FlexMouseEvent")]

 //--------------------------------------
 //  Other metadata
@@ -426,11 +456,23 @@
         if (event.isDefaultPrevented() || !vp || !vp.visible || !visible)
             return;

-        var nSteps:uint = Math.abs(event.delta);
+        // Dispatch the "mouseWheelChanging" event. If preventDefault() is called
+        // on this event, the event will be cancelled.  Otherwise if  the delta
+        // is modified the new value will be used.
+        var changingEvent:FlexMouseEvent = MouseEventUtil.createMouseWheelChangingEvent(event);
+        if (!dispatchEvent(changingEvent))
+        {
+            event.preventDefault();
+            return;
+        }
+
+        const delta:int = changingEvent.delta;
+
+        var nSteps:uint = Math.abs(delta);
         var navigationUnit:uint;

-        // Scroll event.delta "steps".
-        navigationUnit = (event.delta < 0) ? NavigationUnit.RIGHT : NavigationUnit.LEFT;
+        // Scroll delta "steps".
+        navigationUnit = (delta < 0) ? NavigationUnit.RIGHT : NavigationUnit.LEFT;
         for (var hStep:int = 0; hStep < nSteps; hStep++)
         {
             var hspDelta:Number = vp.getHorizontalScrollPositionDelta(navigationUnit);


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.layouts
 {


use uint for the TriangleCulling enum values

--- src/aerys/minko/type/enum/TriangleCulling.as
+++ src/aerys/minko/type/enum/TriangleCulling.as
@@ -7,10 +7,10 @@

 	public final class TriangleCulling
 	{
-		public static const NONE	: int = 0;
-		public static const BACK	: int = 1;
-		public static const FRONT	: int = 2;
-		public static const BOTH	: int = 3;
+		public static const NONE	: uint = 0;
+		public static const BACK	: uint = 1;
+		public static const FRONT	: uint = 2;
+		public static const BOTH	: uint = 3;

 		minko_render static const STRINGS : Vector.<String> = new <String>[
 			Context3DTriangleFace.NONE,


Don't render a scanline if BG is disabled

--- index.as
+++ index.as
@@ -4463,17 +4463,12 @@
   //   printf("WINDOW IS ENABLED\n");
   // }

-  // if not gpu_bg_enable {
-  //   // Background not enabled; turn off all pixels on this line
-  //   // let i = 0;
-  //   // while i < 160 {
-  //   //   *(gpu_framebuffer + uint32(gpu_line) * 160 + i) = 0;
-  //   //
-  //   //   i += 1;
-  //   // }
-  //
-  //   return;
-  // }
+  if not gpu_bg_enable {
+    // Background not enabled
+    // FIXME: Should we do anything special here?
+
+    return;
+  }

   // Line (to be rendered)
   // With a high SCY value, the line wraps around


:bug:

:bug:

--- index.as
+++ index.as
@@ -259,9 +259,9 @@

   // I/O Ports

-  // if address == 0xFF00 {
-  //   return joy_read(address);
-  // }
+  if address == 0xFF00 {
+    return joy_read(address);
+  }

   if (address & 0xF0) >= 0x40 and (address & 0xF0) <= 0x70 {
     // GPU Register
@@ -358,10 +358,10 @@
     return;
   }

-  // if address == 0xFF00 {
-  //   joy_write(address, value);
-  //   return;
-  // }
+  if address == 0xFF00 {
+    joy_write(address, value);
+    return;
+  }

   // GPU Register
   if (address & 0xF0) >= 0x40 and (address & 0xF0) <= 0x70 {
@@ -4246,10 +4246,10 @@
   oam = malloc(160);
   hram = malloc(127);

-  // memset(vram, 0, 0x2000);
-  // memset(wram, 0, 0x2000);
-  // memset(oam, 0, 160);
-  // memset(hram, 0, 127);
+  memset(vram, 0, 0x2000);
+  memset(wram, 0, 0x2000);
+  memset(oam, 0, 160);
+  memset(hram, 0, 127);
 }

 def cpu_fini() {
@@ -4616,7 +4616,7 @@
       } else {
         gpu_line += 1;
       }
-    } else if gpu_line == 153 and gpu_mode_clock >= 56 {
+    } else if gpu_line == 153 and gpu_mode_clock >= 4 {
       gpu_line = 0;
     }
   }
@@ -4732,7 +4732,6 @@
     // Bit 0 - P10 Input Right or Button A (0=Pressed) (Read Only)

     // NOTE: This is backwards logic to me. 0 = True ?
-
     return (
       bit(true, 7) |
       bit(true, 6) |


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridHeaderRenderer.as
+++ frameworks/projects/advancedgrids/src/mx/controls/advancedDataGridClasses/AdvancedDataGridHeaderRenderer.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.controls.advancedDataGridClasses
 {


Send page URL and refr URL fields with all events, not just page views. resolves #16

--- snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/Tracker.as
+++ snowplow-as3-tracker/src/com/snowplowanalytics/snowplow/tracker/Tracker.as
@@ -13,6 +13,7 @@

 package com.snowplowanalytics.snowplow.tracker
 {
+	import com.adobe.net.URI;
 	import com.snowplowanalytics.snowplow.tracker.emitter.Emitter;
 	import com.snowplowanalytics.snowplow.tracker.payload.IPayload;
 	import com.snowplowanalytics.snowplow.tracker.payload.SchemaPayload;
@@ -42,6 +43,10 @@
 		private var hasLocalStorage:Boolean;
 		private var hasScriptAccess:Boolean;

+		private var pageUrl:String = "UNKNOWN";
+		private var pageTitle:String = "UNKNOWN";
+		private var referrer:String = "UNKNOWN";
+
 		/**
 		 * @param emitter Emitter to which events will be sent
 		 * @param subject Subject to be tracked
@@ -51,30 +56,36 @@
 		 * @param base64Encoded Whether JSONs in the payload should be base-64 encoded
 		 */
 		function Tracker(emitter:Emitter, namespace:String, appId:String, subject:Subject = null, stage:Stage = null, base64Encoded:Boolean = true) {
-				this.emitter = emitter;
-				this.appId = appId;
-				this.base64Encoded = base64Encoded;
-				this.namespace = namespace;
-				this.subject = subject;
-				this.trackerVersion = Version.TRACKER;
-				this.platform = DevicePlatform.WEB;
-				this.stage = stage;
-
-				this.playerType = Capabilities.playerType;
-				this.playerVersion = Capabilities.version;
-				this.isDebugger = Capabilities.isDebugger;
-
-				try
-				{
-					SharedObject.getLocal("test");
-					this.hasLocalStorage = true;
-				}
-				catch (e:Error)
-				{
-					this.hasLocalStorage = false;
-				}
-				this.hasScriptAccess = ExternalInterface.available;
+			this.emitter = emitter;
+			this.appId = appId;
+			this.base64Encoded = base64Encoded;
+			this.namespace = namespace;
+			this.subject = subject;
+			this.trackerVersion = Version.TRACKER;
+			this.platform = DevicePlatform.WEB;
+			this.stage = stage;
+
+			this.playerType = Capabilities.playerType;
+			this.playerVersion = Capabilities.version;
+			this.isDebugger = Capabilities.isDebugger;
+
+			try
+			{
+				SharedObject.getLocal("test");
+				this.hasLocalStorage = true;
+			}
+			catch (e:Error)
+			{
+				this.hasLocalStorage = false;
 			}
+			this.hasScriptAccess = ExternalInterface.available;
+
+			if (this.hasScriptAccess) {
+				try { pageUrl = ExternalInterface.call("function getPageUrl() { return document.location.href; }"); } catch(e:Error) { pageUrl = "UNKNOWN"; }
+				try { pageTitle = ExternalInterface.call("function getPageTitle() { return document.title; }"); } catch(e:Error) { pageTitle = "UNKNOWN"; }
+				try { referrer = ExternalInterface.call("function getReferrer() { return document.referrer; }"); } catch(e:Error) { referrer = "UNKNOWN"; }
+			}
+		}

 		/**
 		 * @param payload Payload builder
@@ -91,6 +102,11 @@
 				payload.add(Parameter.NAMESPACE, this.namespace);
 				payload.add(Parameter.TRACKER_VERSION, this.trackerVersion);
 				payload.add(Parameter.EID, Util.getEventId());
+
+				//Add page data
+				payload.add(Parameter.PAGE_URL, pageUrl);
+				payload.add(Parameter.PAGE_TITLE, pageTitle);
+				payload.add(Parameter.PAGE_REFR, referrer);

 				// If timestamp is set to 0, generate one
 				payload.add(Parameter.TIMESTAMP,


Speeds up the event command executor by ignoring empty guards & hooks and using instantiateUnmapped()

--- src/robotlegs/bender/extensions/eventCommandMap/impl/EventCommandExecutor.as
+++ src/robotlegs/bender/extensions/eventCommandMap/impl/EventCommandExecutor.as
@@ -68,13 +68,16 @@
 				if (eventConstructor != Event)
 					_injector.map(_eventClass || eventConstructor).toValue(event);

-				if (guardsApprove(mapping.guards, _injector))
+				if (mapping.guards.length == 0 || guardsApprove(mapping.guards, _injector))
 				{
 					const commandClass:Class = mapping.commandClass;
-					_injector.map(commandClass).asSingleton();
-					command = _injector.getInstance(commandClass);
-					applyHooks(mapping.hooks, _injector);
-					_injector.unmap(commandClass);
+					command = _injector.instantiateUnmapped(commandClass);
+					if (mapping.hooks.length > 0)
+					{
+						_injector.map(commandClass).toValue(command);
+						applyHooks(mapping.hooks, _injector);
+						_injector.unmap(commandClass);
+					}
 				}

 				_injector.unmap(Event);


ConfigUtils: fixed some issues related to air platforms when config merging

--- src/com/as3mxml/asconfigc/utils/ConfigUtils.as
+++ src/com/as3mxml/asconfigc/utils/ConfigUtils.as
@@ -233,7 +233,8 @@
 				{
 					if(AIRPlatformType.hasOwnProperty(key))
 					{
-						result[key] = baseApplication;
+						var keyValue:String = AIRPlatformType[key] as String;
+						result[keyValue] = baseApplication;
 					}
 				}
 			}
@@ -242,7 +243,6 @@
 				result = baseApplication;
 			}
 			return mergeObjectsSimple(application, result);
-
 		}

 		private static function mergeAIROptions(airOptions:Object, baseAIROptions:Object, handlePlatforms:Boolean):Object
@@ -261,6 +261,15 @@
 				if(airOptions.hasOwnProperty(key))
 				{
 					keys.add(key);
+				}
+			}
+			var platforms:Set = new Set();
+			for(key in AIRPlatformType)
+			{
+				if(AIRPlatformType.hasOwnProperty(key))
+				{
+					var keyValue:String = AIRPlatformType[key] as String;
+					platforms.add(keyValue);
 				}
 			}
 			keys.forEach(function(value:String, key:Object, set:Set):void
@@ -269,7 +278,7 @@
 				var hasBase:Boolean = baseAIROptions.hasOwnProperty(key);
 				if(hasConfig && hasBase)
 				{
-					if(handlePlatforms && AIRPlatformType.hasOwnProperty(key))
+					if(handlePlatforms && platforms.has(key))
 					{
 						result[key] = mergeAIROptions(airOptions[key], baseAIROptions[key], false);
 					}


Transferred from the Adobe Open Source Subversion Repository

Revision: 14124
Author:   cframpto@adobe.com
Date:     2010-02-11T17:53:35.882363Z

Log Message:
-----------
Merge 14123 from 4.x branch to trunk.

Log Message:
***********
Two additions/corrections to 14076.  Add key mappings for layoutDirection="rtl" for spark list components.  Correct type of keyCode variable so it is an uint rather than an int to match event.keyCode.

BitmapImage has a hard-coded layout direction="ltr".

QE notes: For layoutDirection="rtl" need to test LEFT, RIGHT, UP and DOWN keys.
Doc notes: None
Bugs: SDK-25330
Reviewed By: Hans
Tests run: checkintests
Is noteworthy for integration: No

Ticket Links:
***********
    http://bugs.adobe.com/jira/browse/SDK-25330

Modified Paths:
**************
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/containers/Accordion.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/ButtonBar.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/CalendarLayout.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/ColorPicker.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/Menu.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/MenuBar.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/RadioButton.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/Tree.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/core/Container.as
    flex/sdk/branches/4.x/frameworks/projects/framework/src/mx/core/UIComponent.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/List.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/RadioButton.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
    flex/sdk/branches/4.x/frameworks/projects/spark/src/spark/primitives/BitmapImage.as

Property Changed:
****************
    flex/sdk/branches/4.x/frameworks/

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk/frameworks</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CalendarLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.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/DropDownListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/SliderThumb.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/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>

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

--- frameworks/projects/mx/src/mx/core/Container.as
+++ frameworks/projects/mx/src/mx/core/Container.as
@@ -5668,9 +5668,9 @@
             direction = ScrollEventDirection.HORIZONTAL;
             oldPos = horizontalScrollPosition;

-            // If rtl layout, need to swap LEFT for RIGHT so correct action
+            // If rtl layout, need to swap LEFT and RIGHT so correct action
             // is done.
-            var keyCode:int = mapKeycodeForLayoutDirection(event);
+            var keyCode:uint = mapKeycodeForLayoutDirection(event);

             switch (keyCode)
             {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12401
Author:   gruehle@adobe.com
Date:     2009-12-03T00:55:48.080560Z

Log Message:
-----------
Spark (SkinnableContainer) creationPolicy was a simple property. The mx (Container) creationPolicy property had logic to inherit the parent's creation policy if not explicitly specified, but this only worked if the parent was also a Container.

This change makes SkinnableContainer.creationPolicy an inheriting property, and fixes mx Containers so they can inherit creationPolicy from SkinnableContainer parents. This is all done behind the scenes by using a private inheriting style for backing storage.

QE notes: Yes, tests need updating for new behavior
Doc notes: No
Bugs: SDK-23955
Reviewer: Ryan
Tests run: checkintests, extensive cyclone testing
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NavigatorContent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>

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

--- frameworks/projects/mx/src/mx/core/Container.as
+++ frameworks/projects/mx/src/mx/core/Container.as
@@ -29,7 +29,6 @@
 import flash.text.TextLineMetrics;
 import flash.ui.Keyboard;
 import flash.utils.getDefinitionByName;
-import flash.utils.getQualifiedClassName;

 import mx.binding.BindingManager;
 import mx.containers.utilityClasses.PostScaleAdapter;
@@ -860,6 +859,21 @@
         invalidateSizeFlag = oldInvalidateSizeFlag;
         invalidateDisplayListFlag = oldInvalidateDisplayListFlag;
     }
+
+    //----------------------------------
+    //  moduleFactory
+    //----------------------------------
+    /**
+     *  @private
+     */
+    override public function set moduleFactory(moduleFactory:IFlexModuleFactory):void
+    {
+        super.moduleFactory = moduleFactory;
+
+        // Register the _creationPolicy style as inheriting. See the creationPolicy
+        // getter for details on usage of this style.
+        styleManager.registerInheritingStyle("_creationPolicy");
+    }

     //----------------------------------
     //  $numChildren
@@ -1197,18 +1211,13 @@
     //  creationPolicy
     //----------------------------------

-    /**
-     *  @private
-     *  Storage for the creationPolicy property.
-     *  This variable is initialized in the construct() method
-     *  using the childDescriptors property in the initObj, which is autogenerated.
-     *  If this Container was not created by the createComponentFromDescriptor() method,
-     *  its childDescriptors property is null.
-     */
-    private var _creationPolicy:String;
-
     [Inspectable(enumeration="all,auto,queued,none")]

+    // Internal flag used when creationPolicy="none".
+    // When set, the value of the backing store _creationPolicy
+    // style is "auto" so descendants inherit the correct value.
+    private var creationPolicyNone:Boolean = false;
+
     /**
      *  The child creation policy for this Container.
      *  ActionScript values can be ContainerCreationPolicy.AUTO,
@@ -1265,7 +1274,15 @@
      */
     public function get creationPolicy():String
     {
-        return _creationPolicy;
+        // Use an inheriting style as the backing storage for this property.
+        // This allows the property to be inherited by either mx or spark
+        // containers, and also to correctly cascade through containers that
+        // don't have this property (ie Group).
+        // This style is an implementation detail and should be considered
+        // private. Do not set it from CSS.
+        if (creationPolicyNone)
+            return ContainerCreationPolicy.NONE;
+        return getStyle("_creationPolicy");
     }

     /**
@@ -1273,7 +1290,22 @@
      */
     public function set creationPolicy(value:String):void
     {
-        _creationPolicy = value;
+        var styleValue:String = value;
+
+        if (value == ContainerCreationPolicy.NONE)
+        {
+            // creationPolicy of none is not inherited by descendants.
+            // In this case, set the style to "auto" and set a local
+            // flag for subsequent access to the creationPolicy property.
+            creationPolicyNone = true;
+            styleValue = ContainerCreationPolicy.AUTO;
+        }
+        else
+        {
+            creationPolicyNone = false;
+        }
+
+        setStyle("_creationPolicy", styleValue);

         setActualCreationPolicies(value);
     }
@@ -3114,23 +3146,15 @@
         // If the author has specified a policy, use it.
         // Otherwise, use the parent's policy.
         // This must be set before createChildren() gets called.
-        if (creationPolicy != null)
-        {
-            actualCreationPolicy = creationPolicy;
-        }
-        else if (parent is Container)
-        {
-            if (Container(parent).actualCreationPolicy ==
-                ContainerCreationPolicy.QUEUED)
-            {
+        if (actualCreationPolicy == null)
+        {
+            if (creationPolicy != null)
+                actualCreationPolicy = creationPolicy;
+
+            if (actualCreationPolicy == ContainerCreationPolicy.QUEUED)
                 actualCreationPolicy = ContainerCreationPolicy.AUTO;
-            }
-            else
-            {
-                actualCreationPolicy = Container(parent).actualCreationPolicy;
-            }
-        }
-
+        }
+
         // It is ok for actualCreationPolicy to be null. Popups require it.

         if (actualCreationPolicy == ContainerCreationPolicy.NONE)


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkComboBoxAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkComboBoxAutomationImpl.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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 spark.automation.delegates.components
 {


Dispatch error event when XML module creation fails.

--- src/com/esri/builder/controllers/supportClasses/WidgetTypeLoader.as
+++ src/com/esri/builder/controllers/supportClasses/WidgetTypeLoader.as
@@ -92,12 +92,11 @@
             if (customWidgetType)
             {
                 dispatchComplete(customWidgetType);
+                return;
             }
-            else
-            {
-                dispatchError();
-            }
-        }
+        }
+
+        dispatchError();
     }

     private function loadModule():void


added the AbstractScriptController.updateRate property to customize the update frequency of the script

--- src/aerys/minko/scene/controller/AbstractScriptController.as
+++ src/aerys/minko/scene/controller/AbstractScriptController.as
@@ -25,6 +25,8 @@
         private var _targetsToAdd       : Vector.<ISceneNode>;
         private var _targetsToRemove    : Vector.<ISceneNode>;

+		private var _updateRate			: Number;
+
         protected function get scene() : Scene
         {
             return _scene;
@@ -48,6 +50,15 @@
 		protected function get viewport() : Viewport
 		{
 			return _viewport;
+		}
+
+		protected function get updateRate() : Number
+		{
+			return _updateRate;
+		}
+		protected function set updateRate(value : Number) : void
+		{
+			_updateRate = value;
 		}

 		public function AbstractScriptController(targetType	: Class = null)
@@ -90,8 +101,12 @@
 														   destination	: BitmapData,
 														   time			: Number) : void
 		{
+			_deltaTime = time - _lastTime;
+
+			if (_updateRate != 0. && deltaTime < 1000. / _updateRate)
+				return;
+
 			_viewport = viewport;
-			_deltaTime = time - _lastTime;
 			_lastTime = time;

             lockTargetsList();


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/mx/src/mx/skins/halo/DataGridSortArrow.as
+++ frameworks/projects/mx/src/mx/skins/halo/DataGridSortArrow.as
@@ -17,6 +17,11 @@

 /**
  *  The skin for the sort arrow in a column header in a DataGrid.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class DataGridSortArrow extends ProgrammaticSkin
 {
@@ -30,6 +35,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function DataGridSortArrow()
 	{


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.components
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 9182
Author:   jszeto@adobe.com
Date:     2009-08-07T22:16:18.490211Z

Log Message:
-----------
PopUpAnchor bug fixes

http://bugs.adobe.com/jira/browse/SDK-22425 - [Marshall Plan] Opening a DropDownList that is in a child application from a different domain from the parent causes a RTE

PopUpAnchor references the stage for some fullScreenMode logic. The fix is to put a try/catch around this code. If we are in a subapplication, accessing the stage’s displayState property is a security violation. It is not a critical calculation, so it is alright if it isn’t run.

Fixing the RTE exposed a different bug involving what transforms to apply to the popUp. The original code was applying the concatenatedMatrix of the PopUpAnchor to the popUp. However, when the PopUpAnchor is in a sub application in a different domain, then the popUp is parented by a systemManager that is a child of the main application. This resulted in concatenated transforms applied to the sub application getting applied twice. The fix is to get the concatenated transform from the popUp’s parent to the PopUpAnchor. I get this transform by taking the concatenated transform and subtracting out the popUp parent’s concatenated transform.

QE notes: Add tests for subapplication/module use cases
Doc notes: None
Bugs: SDK-22425
Reviewer: Alex
Tests run: DropDownList, PopUpAnchor
Is noteworthy for integration: No

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as

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

--- frameworks/projects/spark/src/spark/components/PopUpAnchor.as
+++ frameworks/projects/spark/src/spark/components/PopUpAnchor.as
@@ -13,6 +13,7 @@
 {

 import flash.display.DisplayObject;
+import flash.display.Stage;
 import flash.display.StageDisplayState;
 import flash.events.Event;
 import flash.geom.Matrix;
@@ -25,8 +26,6 @@
 import mx.managers.PopUpManager;
 import mx.styles.ISimpleStyleClient;
 import mx.utils.MatrixUtil;
-
-import spark.components.PopUpPosition;

 use namespace mx_internal;

@@ -364,7 +363,8 @@
     protected function calculatePopUpPosition():Point
     {
         // This implementation doesn't handle rotation
-        var matrix:Matrix = $transform.concatenatedMatrix;
+        var matrix:Matrix = getPopUpMatrix();
+
         var regPoint:Point = new Point();

         var popUpBounds:Rectangle = new Rectangle();
@@ -525,6 +525,20 @@
     }

     /**
+     *  @private Get the concatenated matrix from the PopUpAnchor to the popUp parent
+     */
+    private function getPopUpMatrix():Matrix
+    {
+        // Take the PopUpAnchor's concatenatedMatrix
+        // and subtract out the popUp parent's concatenatedMatrix
+        var matrix:Matrix = systemManager.getSandboxRoot().transform.concatenatedMatrix;
+        matrix.invert();
+        matrix.concat($transform.concatenatedMatrix);
+
+        return matrix;
+    }
+
+    /**
      *  @private
      */
     mx_internal function determinePosition(placement:String, popUpWidth:Number, popUpHeight:Number,
@@ -603,11 +617,19 @@
         var popUpPoint:Point = calculatePopUpPosition();

         // the transformation doesn't take the fullScreenRect in to account
-        // if we are in fulLScreen mode
-        if (stage && stage.displayState != StageDisplayState.NORMAL && stage.fullScreenSourceRect)
-        {
-            popUpPoint.x += stage.fullScreenSourceRect.x;
-            popUpPoint.y += stage.fullScreenSourceRect.y;
+        // if we are in fulLScreen mode. This code will throw a RTE if run from inside of a sandbox.
+        try
+        {
+            var smStage:Stage = systemManager.stage;
+            if (smStage && smStage.displayState != StageDisplayState.NORMAL && smStage.fullScreenSourceRect)
+            {
+                popUpPoint.x += smStage.fullScreenSourceRect.x;
+                popUpPoint.y += smStage.fullScreenSourceRect.y;
+            }
+        }
+        catch (e:Error)
+        {
+            // Ignore the RTE
         }

         // Position the popUp.
@@ -620,8 +642,9 @@

         // apply the color transformation
         DisplayObject(popUp).transform.colorTransform = $transform.concatenatedColorTransform
-    }
-
+
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Event Handlers
@@ -649,4 +672,4 @@
     }

 }
-}+}