Transferred from the Adobe Open Source Subversion Repository

Revision: 3960
Author:   rfrishbe@adobe.com
Date:     2008-10-29T21:41:47.852153Z

Log Message:
-----------
Small cleanup for FxApplication.  Now that we have unique names for FxApplication and Applicaiton, we can change the background color in defaults.css.  This is related to SDK-16721, but is more cleanup than actually fixing the bug, which is about the compiler default background color.

QE Notes: None
Doc Notes: None
Bugs: SDK-16721
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxApplication.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>

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

--- frameworks/projects/spark/src/spark/components/Application.as
+++ frameworks/projects/spark/src/spark/components/Application.as
@@ -191,11 +191,6 @@
         // documentDescriptor property for the application object.
         // We get the id and the creationPolicy, which we want to
         // set very early, from that descriptor.
-
-        // because we don't have namespace-specific styles yet
-        // just set the default here
-        // TODO (rfrishbe): remove this...
-        setStyle("backgroundColor", "white");
     }

     //--------------------------------------------------------------------------


Allow overriding for mustella

Allow overriding for mustella

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

--- frameworks/projects/spark/src/spark/components/Application.as
+++ frameworks/projects/spark/src/spark/components/Application.as
@@ -1156,7 +1156,7 @@
 		// softKeyboard becoming visible, we need to compare against
 		// the height without the keyboard active
 		if (isSoftKeyboardActive && softKeyboardBehavior == "none" && resizeForSoftKeyboard)
-			actualHeight += stage.softKeyboardRect.height;
+			actualHeight += softKeyboardRect.height;

         return width > actualHeight ? "landscape" : "portrait";
     }
@@ -1855,7 +1855,7 @@
             }

             // Get the keyboard size
-            var keyboardRect:Rectangle = stage.softKeyboardRect;
+            var keyboardRect:Rectangle = softKeyboardRect;

             if (keyboardRect.height > 0)
                 isSoftKeyboardActive = true;
@@ -2147,6 +2147,16 @@
         if (!dispatchEvent(event))
             event.preventDefault();
     }
+
+	mx_internal var _softKeyboardRect:Rectangle;
+
+	mx_internal function get softKeyboardRect():Rectangle
+	{
+		if (_softKeyboardRect == null)
+			return stage.softKeyboardRect;
+
+		return _softKeyboardRect;
+	}
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 4792
Author:   cframpto@adobe.com
Date:     2009-02-02T19:18:40.965487Z

Log Message:
-----------
FxRadioButton/FxRadioButtonGroup bugs.

QE Notes:
Doc Notes:
Bugs: SDK-18437, SDK-18468, SDK-18261, SDK-18460, SDK-18438
Reviewers: Darrell

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/bundles/en_US/components.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxRadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxRadioButton.as</path>

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

--- frameworks/projects/spark/src/spark/components/RadioButton.as
+++ frameworks/projects/spark/src/spark/components/RadioButton.as
@@ -12,6 +12,7 @@
 package mx.components
 {
 import flash.events.Event;
+import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
 import flash.ui.Keyboard;
@@ -22,8 +23,6 @@
 import mx.events.ItemClickEvent;
 import mx.managers.IFocusManager;
 import mx.managers.IFocusManagerGroup;
-
-use namespace mx_internal;

 //--------------------------------------
 //  Styles
@@ -112,9 +111,7 @@

         // Start out in the default group.  The button is always in a group,
         // either explicitly or implicitly.
-        groupName = "radioGroup";
-
-        _buttonEnabled = enabled;
+        groupName = "radioGroup";
     }

     //--------------------------------------------------------------------------
@@ -129,6 +126,17 @@
      */
     mx_internal var indexNumber:int = 0;

+    /**
+     *  @private
+     *  The FxRadioButtonGroup that this radio button is in.  The group property
+     *  should not be used to keep track of the radio button group for this radio
+     *  button.  During state transitions, the radio button may come
+     *  and go from the group and the group property is not reset.  The group
+     *  property, if initially set, is needed when the radio button is readded
+     *  to the group.
+     */
+    mx_internal var radioButtonGroup:FxRadioButtonGroup = null;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties
@@ -153,8 +161,13 @@

     /**
      *  The FxRadioButtonGroup object to which this FxRadioButton belongs.
+     *  All radio buttons in the group must have the same parent.
      *
      *  @default "undefined"
+     *  @see #groupName
+     *
+     *  @throws ArgumentError If the radio button has a different parent than
+     *  the other radio buttons already in the group.
      */
     public function get group():FxRadioButtonGroup
     {
@@ -178,20 +191,20 @@
                     // Special automaticRadioButtonGroup slot to hold generated
                     // radio button groups.  Shared with halo so prefix
                     // groupName to differentiate.
-                    if (document.automaticRadioButtonGroups &&
-                        document.automaticRadioButtonGroups[autoGroupIndex])
+                    if (document.mx_internal::automaticRadioButtonGroups &&
+                        document.mx_internal::automaticRadioButtonGroups[autoGroupIndex])
                     {
                         g = FxRadioButtonGroup(
-                            document.automaticRadioButtonGroups[autoGroupIndex]);
+                            document.mx_internal::automaticRadioButtonGroups[autoGroupIndex]);
                     }
                 }
                 if (!g)
                 {
                     g = new FxRadioButtonGroup(IFlexDisplayObject(document));

-                    if (!document.automaticRadioButtonGroups)
-                        document.automaticRadioButtonGroups = [];
-                    document.automaticRadioButtonGroups[autoGroupIndex] = g;
+                    if (!document.mx_internal::automaticRadioButtonGroups)
+                        document.mx_internal::automaticRadioButtonGroups = [];
+                    document.mx_internal::automaticRadioButtonGroups[autoGroupIndex] = g;
                 }
                 else if (!(g is FxRadioButtonGroup))
                 {
@@ -233,8 +246,8 @@
      *  @private
      *  Storage for groupName property.
      */
-    mx_internal var _groupName:String;
-
+    private var _groupName:String;
+
     /**
      *  @private
      */
@@ -247,8 +260,14 @@
      *  Specifies the name of the group to which this FxRadioButton control belongs, or
      *  specifies the value of the id property of a FxRadioButtonGroup control
      *  if this FxRadioButton is part of a group defined by a FxRadioButtonGroup control.
+     *  All radio buttons with the same groupName will be in the same tab group.
+     *  All radio buttons in the group must have the same parent.
      *
-     *  @default "undefined"
+     *  @default "radioButton"
+     *  @see #group
+     *
+     *  @throws ArgumentError If the radio button has a different parent than
+     *  the other radio buttons already in the group.
      */
     public function get groupName():String
     {
@@ -330,13 +349,16 @@
      */
     override protected function commitProperties():void
     {
-        super.commitProperties();
-
         if (groupChanged)
         {
             addToGroup();
             groupChanged = false;
         }
+
+        // Do this after radio button is added to the group so when the
+        // skin state is set, enabled and selected will return the correct values,
+        // and the correct skin will be used.
+        super.commitProperties();
     }

     //--------------------------------------------------------------------------
@@ -347,7 +369,22 @@

     /**
      *  @private
-     *  automaticRadioButtonGroups is shared with halo radio button groups.
+     *  The radio button was added or removed from a radio button group.  This
+     *  may change the value of the button's enable property.
+     */
+    mx_internal function invalidateRadioButtonState():void
+    {
+        // If the state of the button combined with the group state is different
+        // invalidate the button which will cause the skin to be changed by
+        // FxComponent.commitProperties() which uses skinStateIsDirty, enabled
+        // and selected to determine if the skin should be changed.
+        if (super.enabled != enabled)
+            invalidateButtonState();
+    }
+
+    /**
+     *  @private
+     *  mx_internal::automaticRadioButtonGroups is shared with halo radio button groups.
      *  Gumbo radio button groups are prefixed with _fx to differentiate the
      *  halo groups which are stored in the same table.
      */
@@ -360,21 +397,22 @@
      *  @private
      *  Create radio button group if it does not exist
      *  and add the instance to the group.
+     *
+     *  @throws ArgumentError If the radio button has a different parent than
+     *  the other radio buttons already in the group.
      */
     private function addToGroup():FxRadioButtonGroup
     {
         var g:FxRadioButtonGroup = group; // Trigger getting the group
         if (g)
         {
-            g.addInstance(this);
-
-            // If this button is selected, then change the group selection.
-            if (selected && g.selection != this)
-                g.setSelection(this, false);
-
-            // If this button is joining a disabled group, then disable the button.
-            // Don't use the enabled setter so that _buttonEnabled remains untouched.
-            setEnabled();
+            if (g.numRadioButtons && g.getRadioButtonAt(0).parent != parent)
+            {
+                throw ArgumentError(
+                    resourceManager.getString("components", "rbMustHaveSameParent"));
+            }
+
+            g.mx_internal::addInstance(this);
         }

         return g;
@@ -383,7 +421,7 @@
     /**
      *  @private
      */
-    mx_internal function removeFromGroup():void
+    private function removeFromGroup():void
     {
         // If the radio button was in a group, remove it.
         this.dispatchEvent(new Event(Event.REMOVED));
@@ -395,9 +433,9 @@
         // specified by groupName.
         try
         {
-            if (document.automaticRadioButtonGroups[autoGroupIndex].numRadioButtons == 0)
-            {
-                delete document.automaticRadioButtonGroups[autoGroupIndex];
+            if (document.mx_internal::automaticRadioButtonGroups[autoGroupIndex].numRadioButtons == 0)
+            {
+                delete document.mx_internal::automaticRadioButtonGroups[autoGroupIndex];
             }
         }
         catch(e:Error)
@@ -417,20 +455,21 @@
         if (fm)
             fm.showFocusIndicator = true;

-        for (var i:int = 1; i <= indexNumber; i++)
-        {
-            var radioButton:FxRadioButton = g.getRadioButtonAt(indexNumber - i);
+        for (var i:int = 1; i <= mx_internal::indexNumber; i++)
+        {
+            var radioButton:FxRadioButton =
+                    g.getRadioButtonAt(mx_internal::indexNumber - i);
             if (radioButton && radioButton.enabled)
             {
                 if (moveSelection)
-                    g.setSelection(radioButton);
+                    g.mx_internal::setSelection(radioButton);
                 radioButton.setFocus();
                 return;
             }
         }

-        if (moveSelection && g.getRadioButtonAt(indexNumber) != g.selection)
-            g.setSelection(this);
+        if (moveSelection && g.getRadioButtonAt(mx_internal::indexNumber) != g.selection)
+            g.mx_internal::setSelection(this);

         this.drawFocus(true);
     }
@@ -447,20 +486,20 @@
         if (fm)
             fm.showFocusIndicator = true;

-        for (var i:int = indexNumber + 1; i < g.numRadioButtons; i++)
+        for (var i:int = mx_internal::indexNumber + 1; i < g.numRadioButtons; i++)
         {
             var radioButton:FxRadioButton = g.getRadioButtonAt(i);
             if (radioButton && radioButton.enabled)
             {
                 if (moveSelection)
-                    g.setSelection(radioButton);
+                    g.mx_internal::setSelection(radioButton);
                 radioButton.setFocus();
                 return;
             }
         }

-        if (moveSelection && g.getRadioButtonAt(indexNumber) != g.selection)
-            g.setSelection(this);
+        if (moveSelection && g.getRadioButtonAt(mx_internal::indexNumber) != g.selection)
+            g.mx_internal::setSelection(this);
         this.drawFocus(true);
     }

@@ -469,51 +508,25 @@
      */
     private function setThis():void
     {
-        if (!_group)
+        if (!mx_internal::radioButtonGroup)
             addToGroup();

         var g:FxRadioButtonGroup = group;
         if (g.selection != this)
-            g.setSelection(this);
-    }
-
-
-    /**
-     *  @private
-     *  Enable the component if the group it is enabled and the radio button
-     *  itself is enabled. If the group is disabled the button is disabled.
-     */
-    mx_internal function setEnabled():void
-    {
-        if (_group && !_group.enabled)
-        {
-            super.enabled = false;
-        }
-        else
-        {
-            super.enabled = _buttonEnabled;
-        }
-
-        invalidateButtonState();
-    }
-
-    /**
-     *  @private
-     *  Storage for enabled property.  It must be merged with the FxRadionButtonGroup
-     *  enabled property to determine if the button is enabled.
-     */
-    mx_internal var _buttonEnabled:Boolean;
-
-    /**
+            g.mx_internal::setSelection(this);
+    }
+
+   /**
      *  @private
      *  The radio button group and the radio button each have enabled properties.
-     *  The underlying component is enabled if the group is enabled and the button
+     *  The radio button component is enabled if the group is enabled and the button
      *  itself is enabled.
      */
-    override public function set enabled(value:Boolean):void
-    {
-        _buttonEnabled = value;
-        setEnabled();
+    override public function get enabled():Boolean
+    {
+        return super.enabled &&
+                    (!mx_internal::radioButtonGroup ||
+                        mx_internal::radioButtonGroup.enabled);
     }

     //--------------------------------------------------------------------------
@@ -521,7 +534,18 @@
     //  Overridden event handlers: UIComponent
     //
     //--------------------------------------------------------------------------
-
+    /**
+     *  @private
+     */
+    override protected function focusInHandler(event:FocusEvent):void
+    {
+        var fm:IFocusManager = focusManager;
+        if (fm)
+            fm.showFocusIndicator = enabled;
+
+        super.focusInHandler(event);
+    }
+
     /**
      *  @private
      *  Support the use of keyboard within the group.
@@ -590,20 +614,20 @@
         if (!enabled || selected)
             return; // prevent a selected button from dispatching "click"

-        if (!_group)
+        if (!mx_internal::radioButtonGroup)
             addToGroup();

         // Must call super.clickHandler() before setting
         // the group's selection.
         super.onClick(event);

-        group.setSelection(this);
+        group.mx_internal::setSelection(this);

         // Dispatch an itemClick event from the FxRadioButtonGroup.
         var itemClickEvent:ItemClickEvent =
             new ItemClickEvent(ItemClickEvent.ITEM_CLICK);
         itemClickEvent.label = label;
-        itemClickEvent.index = indexNumber;
+        itemClickEvent.index = mx_internal::indexNumber;
         itemClickEvent.relatedObject = this;
         itemClickEvent.item = value;
         group.dispatchEvent(itemClickEvent);


Transferred from the Adobe Open Source Subversion Repository

Revision: 10826
Author:   rfrishbe@adobe.com
Date:     2009-10-02T17:28:43.435550Z

Log Message:
-----------
When a Video is removed from the stage or becomes invisible, the video will now pause playback.  This features is controlled through a new property, playWhenHidden, which defaults to false (meaning we don't play the video when it's hidden).  When it becomes visible/on-stage again, we will start playing the video if autoPlay=true.  Otherwise, the video will not automatically start playback.

This property still needs to be reviewed by PARB.

Also, updating a comment in SkinnableContainer relating to a FIXME I own.

QE notes: -
Doc notes: -
Bugs: SDK-21928
Reviewer: Deepa
Tests run: checkintests, mustella VideoElement/VideoPlayer
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/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/VideoPlayer.as
+++ frameworks/projects/spark/src/spark/components/VideoPlayer.as
@@ -16,7 +16,6 @@
 import fl.video.flvplayback_internal;

 import flash.display.DisplayObject;
-import flash.display.Stage;
 import flash.display.StageDisplayState;
 import flash.events.Event;
 import flash.events.FullScreenEvent;
@@ -24,19 +23,13 @@
 import flash.events.MouseEvent;
 import flash.events.ProgressEvent;
 import flash.events.TimerEvent;
-import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.utils.Timer;

-import mx.core.ContainerGlobals;
 import mx.core.FlexGlobals;
-import mx.core.IFlexDisplayObject;
 import mx.core.IVisualElementContainer;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
-import mx.events.SandboxMouseEvent;
-import mx.managers.IFocusManagerContainer;
-import mx.managers.LayoutManager;
 import mx.utils.BitFlagUtil;

 import spark.components.mediaClasses.MuteButton;
@@ -44,13 +37,12 @@
 import spark.components.mediaClasses.StreamingVideoSource;
 import spark.components.mediaClasses.VolumeBar;
 import spark.components.supportClasses.ButtonBase;
-import spark.components.supportClasses.Range;
 import spark.components.supportClasses.SkinnableComponent;
+import spark.components.supportClasses.TextBase;
 import spark.components.supportClasses.ToggleButtonBase;
 import spark.events.TrackBaseEvent;
 import spark.events.VideoEvent;
 import spark.primitives.VideoElement;
-import spark.components.supportClasses.TextBase;

 use namespace mx_internal;

@@ -455,6 +447,11 @@
      *  @private
      */
     private static const VOLUME_PROPERTY_FLAG:uint = 1 << 6;
+
+    /**
+     *  @private
+     */
+    private static const PLAY_WHEN_HIDDEN_PROPERTY_FLAG:uint = 1 << 7;

     //--------------------------------------------------------------------------
     //
@@ -993,6 +990,54 @@
     }

     //----------------------------------
+    //  playWhenHidden
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  @copy spark.primitives.VideoElement#playWhenHidden
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get playWhenHidden():Boolean
+    {
+        if (videoElement)
+        {
+            return videoElement.playWhenHidden;
+        }
+        else
+        {
+            var v:* = videoElementProperties.playWhenHidden;
+            return (v === undefined) ? false : v;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    public function set playWhenHidden(value:Boolean):void
+    {
+        if (videoElement)
+        {
+            videoElement.playWhenHidden = value;
+            videoElementProperties = BitFlagUtil.update(videoElementProperties as uint,
+                PLAY_WHEN_HIDDEN_PROPERTY_FLAG, true);
+        }
+        else if (videoElementProperties)
+        {
+            videoElementProperties.playWhenHidden = value;
+        }
+        else
+        {
+            videoElementProperties = {playWhenHidden: value};
+        }
+    }
+
+    //----------------------------------
     //  source
     //----------------------------------

@@ -1120,6 +1165,20 @@
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  We override setVisible so that when we aren't visible, we stop playback of the
+     *  video in certain cases.  We just push this down via parentVisibility to
+     *  VideoElement
+     */
+    override public function setVisible(value:Boolean, noEvent:Boolean=false) : void
+    {
+        super.setVisible(value, noEvent);
+
+        if (videoElement)
+            videoElement.parentVisibility = value;
+    }

     /**
      *  @private
@@ -1259,6 +1318,13 @@
                                                             MUTED_PROPERTY_FLAG, true);
                 }

+                if (videoElementProperties.playWhenHidden !== undefined)
+                {
+                    videoElement.playWhenHidden = videoElementProperties.playWhenHidden;
+                    newVideoProperties = BitFlagUtil.update(newVideoProperties as uint,
+                        PLAY_WHEN_HIDDEN_PROPERTY_FLAG, true);
+                }
+
                 // these are state properties just carried over from an old video element
                 if (videoElementProperties.playheadTime !== undefined ||
                     videoElementProperties.playing !== undefined)
@@ -1456,6 +1522,12 @@
                 propertySet = true;
             }

+            if (BitFlagUtil.isSet(videoElementProperties as uint, PLAY_WHEN_HIDDEN_PROPERTY_FLAG))
+            {
+                newVideoProperties.playWhenHidden = videoElement.playWhenHidden;
+                propertySet = true;
+            }
+
             // push our current state (where we were in the video and whether we were playing)
             // so that the new skin gets these as well
             newVideoProperties.playheadTime = videoElement.playheadTime;
@@ -1823,6 +1895,11 @@

             // need it to go into full screen state for the skin
             invalidateSkinState();
+
+            // keep track of playWhenHidden b/c we will set it to true temporarily
+            // so that the video does not pause when we reparent it to the top
+            // level application
+            var oldPlayWhenHidden:Boolean = playWhenHidden;

             // let's get it off of our layout system so it doesn't interfere with
             // the sizing and positioning. Then let's resize it to be
@@ -1837,6 +1914,7 @@
                                     deblocking: videoElement.videoPlayer.deblocking,
                                     includeInLayout: this.includeInLayout};
             includeInLayout = false;
+            playWhenHidden = true;

             // remove from old parent
             if (parent is IVisualElementContainer)
@@ -1883,6 +1961,8 @@
             fullScreenHideControlTimer.addEventListener(TimerEvent.TIMER_COMPLETE,
                 fullScreenHideControlTimer_timerCompleteHandler, false, 0, true);

+            playWhenHidden = oldPlayWhenHidden;
+
             // use stage or systemManager?
             systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_DOWN, resetFullScreenHideControlTimer);
             systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_MOVE, resetFullScreenHideControlTimer);
@@ -1944,6 +2024,12 @@
         // fullScreenButton_clickHandler
         if (event.fullScreen)
             return;
+
+        // keep track of playWhenHidden b/c we will set it to true temporarily
+        // so that the video does not pause when we reparent it to its original
+        // parent
+        var oldPlayWhenHidden:Boolean = playWhenHidden;
+        playWhenHidden = true;

         // set the fullScreen variable back to false and remove this event listener
         fullScreen = false;
@@ -1975,6 +2061,7 @@
             beforeFullScreenInfo.parent.addChildAt(this, beforeFullScreenInfo.childIndex);

         includeInLayout = beforeFullScreenInfo.includeInLayout;
+        playWhenHidden = oldPlayWhenHidden;

         beforeFullScreenInfo = null;


Return a copy because when the source of the data changes we destroy the bitmap.  If a developer is holding a reference to the actual bitmap they will have an invalid reference.

git-svn-id: 7d913817b0a978d84de757191e4bce372605a781@1403828 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/primitives/BitmapImage.as
+++ frameworks/projects/spark/src/spark/primitives/BitmapImage.as
@@ -242,6 +242,8 @@
      */
     public function get bitmapData():BitmapData
     {
+		//We return a copy because when the source of the data changes we destroy the bitmap
+		//If a developer is holding a reference to the actual bitmap they will have an invalid reference
         return _bitmapData ? _bitmapData.clone() : _bitmapData;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18776
Author:   hmuller@adobe.com
Date:     2010-11-22T16:50:41.107244Z

Log Message:
-----------
BitmapImage now dispatches FlexEvent.MEASURED_SIZE_PRELIMINARY,FINAL events and GridLayout consumes the latter.

QE notes: unrelated test, spark/primitives/Graphic/SWFs/FXG_Integration consistently crashes FP on cyclone server
Doc notes:
Bugs: SDK-28325
Reviewer: Corey
Tests run: checkin, mustella
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>

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

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

 package spark.components.gridClasses
 {
+import flash.display.DisplayObject;
 import flash.geom.Rectangle;
 import flash.utils.Dictionary;
 import flash.utils.getTimer;
@@ -28,12 +29,14 @@
 import mx.core.mx_internal;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
+import mx.events.FlexEvent;
 import mx.events.PropertyChangeEvent;
 import mx.managers.ILayoutManagerClient;
 import mx.managers.ILayoutManagerContainerClient;

 import spark.components.DataGrid;
 import spark.components.Grid;
+import spark.components.supportClasses.GroupBase;
 import spark.layouts.supportClasses.LayoutBase;

 use namespace mx_internal;
@@ -191,6 +194,30 @@
     //----------------------------------
     //  useVirtualLayout
     //----------------------------------
+
+    //----------------------------------
+    //  target
+    //----------------------------------
+
+    private var _target:GroupBase;
+
+    /**
+     * @private
+     */
+    override public function set target(value:GroupBase):void
+    {
+        if (_target == value)
+            return;
+
+        if (_target)
+            _target.removeEventListener(FlexEvent.MEASURED_SIZE_FINAL, measuredSizeFinalHandler);
+
+        _target = value;
+        super.target = value;
+
+        if (_target)
+            _target.addEventListener(FlexEvent.MEASURED_SIZE_FINAL, measuredSizeFinalHandler, false, 0, true);
+    }

     /**
      *  GridLayout only supports virtual layout, the value of this property can not be changed.
@@ -212,7 +239,7 @@
      */
     override public function set useVirtualLayout(value:Boolean):void
     {
-    }
+    }

     //--------------------------------------------------------------------------
     //
@@ -363,6 +390,36 @@
         if (scrollR && !visibleItemRenderersBounds.containsRect(scrollR))
             grid.invalidateDisplayList();
     }
+
+    /**
+     *  @private
+     *  Runs when a renderer's measured size has changed, typically because an asynchronously
+     *  loaded image has completed loading.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    private function measuredSizeFinalHandler(event:FlexEvent):void
+    {
+        if (!grid || !grid.variableRowHeight)
+            return;
+
+        var target:DisplayObject = event.target.parent as DisplayObject;
+        var renderer:IGridItemRenderer = null;
+
+        while (target)
+        {
+            renderer = target as IGridItemRenderer;
+            if (renderer)
+                break;
+            target = target.parent as DisplayObject;
+        }
+
+        if (renderer && renderer.grid)
+            renderer.grid.invalidateCell(renderer.rowIndex, renderer.columnIndex);
+    }

     /**
 	 *  @private
@@ -532,7 +589,7 @@

     //--------------------------------------------------------------------------
     //
-    //  DataGrid Access
+    //  Grid Access
     //
     //--------------------------------------------------------------------------


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@1284891 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as
+++ frameworks/projects/spark/src/spark/globalization/LastOperationStatus.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 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: 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@1288267 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/sparkskins/src/mx/skins/spark/ContainerBorderSkin.as
+++ frameworks/projects/sparkskins/src/mx/skins/spark/ContainerBorderSkin.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Don't clear out the ATF source bytes when handling lost context.

--- runtime/src/main/as/flump/display/Loader.as
+++ runtime/src/main/as/flump/display/Loader.as
@@ -116,7 +116,9 @@
         var scale :Number = atlas.scaleFactor;
         if (_lib.textureFormat == "atf") {
             baseTextureLoaded(Texture.fromAtfData(bytes, scale, _libLoader.generateMipMaps), atlas);
-            ByteArray(bytes).clear();
+            if (!Starling.handleLostContext) {
+                ByteArray(bytes).clear();
+            }
         } else {
             const atlasFuture :Future = loader.loadFromBytes(bytes, _pngLoaders);
             atlasFuture.failed.connect(onPngLoadingFailed);


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@1251959 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation_flashflexkit/src/mx/automation/delegates/flashflexkit/FlexContentHolderAutomationImpl.as
+++ frameworks/projects/automation_flashflexkit/src/mx/automation/delegates/flashflexkit/FlexContentHolderAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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: 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@1290617 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPHierarchy.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPHierarchy.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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: 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@1259255 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/core/IConstraintClient.as
+++ frameworks/projects/framework/src/mx/core/IConstraintClient.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 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: 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@1261343 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/logging/AbstractTarget.as
+++ frameworks/projects/framework/src/mx/logging/AbstractTarget.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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: 10826
Author:   rfrishbe@adobe.com
Date:     2009-10-02T17:28:43.435550Z

Log Message:
-----------
When a Video is removed from the stage or becomes invisible, the video will now pause playback.  This features is controlled through a new property, playWhenHidden, which defaults to false (meaning we don't play the video when it's hidden).  When it becomes visible/on-stage again, we will start playing the video if autoPlay=true.  Otherwise, the video will not automatically start playback.

This property still needs to be reviewed by PARB.

Also, updating a comment in SkinnableContainer relating to a FIXME I own.

QE notes: -
Doc notes: -
Bugs: SDK-21928
Reviewer: Deepa
Tests run: checkintests, mustella VideoElement/VideoPlayer
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/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -24,9 +24,6 @@
 import fl.video.VideoState;
 import fl.video.flvplayback_internal;

-import flash.display.DisplayObject;
-import flash.display.DisplayObjectContainer;
-import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.ProgressEvent;
 import flash.media.Video;
@@ -36,7 +33,6 @@

 import spark.components.mediaClasses.StreamItem;
 import spark.components.mediaClasses.StreamingVideoSource;
-import spark.core.IGraphicElement;
 import spark.events.VideoEvent;

 use namespace mx_internal;
@@ -183,6 +179,11 @@

         // create the underlying FLVPlayback class
         createUnderlyingVideoPlayer();
+
+        // added and removed event listeners to see whether we should
+        // start or stop the video
+        addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
+        addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);
     }

     //--------------------------------------------------------------------------
@@ -197,7 +198,7 @@
      *  future, we may change to a new implementation.
      */
     mx_internal var videoPlayer:VideoPlayer;
-
+
     //--------------------------------------------------------------------------
     //
     //  Properties
@@ -207,15 +208,15 @@
     //----------------------------------
     //  autoPlay
     //----------------------------------
-
+
     /**
      *  @private
      *  Storage for autoPlay property.
      */
     private var _autoPlay:Boolean = true;
-
+
     [Inspectable(category="General", defaultValue="true")]
-
+
     /**
      *  Specifies whether the video should start playing immediately when the
      *  source property is set.
@@ -241,7 +242,7 @@
     {
         return _autoPlay;
     }
-
+
     /**
      * @private (setter)
      */
@@ -251,6 +252,24 @@
             return;

         _autoPlay = value;
+    }
+
+    /**
+     *  @private
+     *  Whether we should be playing or not
+     */
+    private function get effectivePlay():Boolean
+    {
+        return playWhenHidden || (visible && _isOnDisplayList && enabled && _parentVisibility);
+    }
+
+    /**
+     *  @private
+     *  Whether we should autoPlay or not
+     */
+    private function get effectiveAutoPlay():Boolean
+    {
+        return autoPlay && effectivePlay;
     }

     //----------------------------------
@@ -287,10 +306,10 @@
     //----------------------------------
     //  enabled
     //----------------------------------
-
+
     [Inspectable(category="General", enumeration="true,false", defaultValue="true")]
     [Bindable("enabledChanged")]
-
+
     /**
      *  @inheritDoc
      *
@@ -360,11 +379,11 @@
     {
         _loop = value;
     }
-
+
     //----------------------------------
     //  maintainAspectRatio
     //----------------------------------
-
+
     /**
      *  @private
      *  Storage for maintainAspectRatio property.
@@ -372,7 +391,7 @@
     private var _maintainAspectRatio:Boolean = true;

     [Inspectable(Category="General", defaultValue="true")]
-
+
     /**
      *  Specifies whether the control should maintain the original aspect ratio
      *  while resizing the video.
@@ -408,7 +427,7 @@
                 videoPlayer.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
             else
                 videoPlayer.scaleMode = VideoScaleMode.EXACT_FIT;
-
+
             invalidateSize();
             invalidateDisplayList();
         }
@@ -464,13 +483,42 @@
     }

     //----------------------------------
+    //  parentVisibility
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _parentVisibility:Boolean = true;
+
+    /**
+     *  @private
+     *  Used so that VideoPlayer can reach down and change our effectivePlay/effectiveAutoPlay flag
+     */
+    mx_internal function set parentVisibility(value:Boolean) : void
+    {
+        _parentVisibility = value;
+
+        // if we want our playback to be controlled by visibility
+        if (!playWhenHidden)
+        {
+            // if we shouldn't be playing and we are, then pause it
+            // otherwise if we aren't playing and we should be, then play
+            if (!effectivePlay && playing)
+                pause();
+            else if (effectiveAutoPlay && !playing)
+                play();
+        }
+    }
+
+    //----------------------------------
     //  playheadTime
     //----------------------------------

     [Bindable("playheadUpdate")]
     [Bindable("playheadTimeChanged")]
     [Inspectable(Category="General", defaultValue="0")]
-
+
     /**
      *  Playhead position, measured in seconds, since the video starting
      *  playing.
@@ -563,6 +611,58 @@
     }

     //----------------------------------
+    //  playWhenHidden
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage variable for playWhenHidden
+     */
+    private var _playWhenHidden:Boolean = false;
+
+    [Inspectable(category="General", defaultValue="false")]
+
+    /**
+     *  Controls whether the video continues to play when it is
+     *  hidden.  The video is hidden when either visible
+     *  is set to false or when the video is taken off
+     *  of the display list.  If set to false, the video
+     *  will pause playback until the video is visible again.  If set to
+     *  true the video will continue to play when it is hidden.
+     *  The default is false.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get playWhenHidden():Boolean
+    {
+        return _playWhenHidden;
+    }
+
+    /**
+     *  @private
+     */
+    public function set playWhenHidden(value:Boolean):void
+    {
+        _playWhenHidden = value;
+
+        // if we want our playback to be controlled by visibility
+        if (!playWhenHidden)
+        {
+            // if we shouldn't be playing and we are, then pause it
+            // otherwise if we aren't playing and we should be, then play
+            if (!effectivePlay && playing)
+                pause();
+            else if (effectiveAutoPlay && !playing)
+                play();
+        }
+    }
+
+    //----------------------------------
     //  source
     //----------------------------------

@@ -595,7 +695,7 @@
     {
         return _source;
     }
-
+
     /**
      * @private (setter)
      */
@@ -638,14 +738,15 @@
         // String and the current item being played is a String
         // or if the last item was null or an empty string
         if ( !((sourceLastPlayed is String && source is String) ||
-             (sourceLastPlayed == null || (sourceLastPlayed is String && String(sourceLastPlayed).length == 0))))
+            (sourceLastPlayed == null || (sourceLastPlayed is String && String(sourceLastPlayed).length == 0))))
         {
             createUnderlyingVideoPlayer();
         }

         sourceLastPlayed = null;

-        if (autoPlay && enabled)
+        // play if we should be autoPlaying.  Otherwise, just load the video.
+        if (effectiveAutoPlay)
             play();
         else
             load();
@@ -654,7 +755,7 @@
     //----------------------------------
     //  totalTime
     //----------------------------------
-
+
     [Bindable("complete")]
     [Bindable("metadataReceived")]
     [Bindable("totalTimeChanged")]
@@ -682,7 +783,7 @@
     //----------------------------------
     //  videoObject
     //----------------------------------
-
+
     /**
      *  The underlying flash player flash.media.Video object
      *
@@ -702,7 +803,7 @@

     [Bindable("volumeChanged")]
     [Inspectable(category="General", defaultValue="1.0")]
-
+
     /**
      *  The volume level, specified as an value between 0 and 1.
      *
@@ -736,6 +837,26 @@

     /**
      *  @private
+     *  Override setVisible to see if we should pause or play or video
+     */
+    override public function setVisible(value:Boolean, noEvent:Boolean=false) : void
+    {
+        super.setVisible(value, noEvent);
+
+        // if we want our playback to be controlled by visibility
+        if (!playWhenHidden)
+        {
+            // if we shouldn't be playing and we are, then pause it
+            // otherwise if we aren't playing and we should be, then play
+            if (!effectivePlay && playing)
+                pause();
+            else if (effectiveAutoPlay && !playing)
+                play();
+        }
+    }
+
+    /**
+     *  @private
      *  We do different things in the source setter based on if we
      *  are initialized or not.
      */
@@ -773,7 +894,7 @@
         {
             videoPlayerProperties = {autoRewind: videoPlayer.autoRewind,
                                      scaleMode: videoPlayer.scaleMode};
-
+
             // if we try to stop and are throwing away this video, just
             // ignore any errors. This might happen if the connection went
             // bad or something else and we're trying to throw it away anyways.
@@ -794,7 +915,7 @@
             videoPlayer.removeEventListener(ProgressEvent.PROGRESS, dispatchEvent);
             videoPlayer.removeEventListener(fl.video.VideoEvent.READY, videoPlayer_readyHandler);
             videoPlayer.removeEventListener(fl.video.VideoEvent.STATE_CHANGE, videoPlayer_stateChangeHandler);
-
+
             removeChild(videoPlayer);
         }

@@ -805,7 +926,7 @@
         {
             videoPlayer.autoRewind = videoPlayerProperties.autoRewind;
             videoPlayer.scaleMode = videoPlayerProperties.scaleMode;
-
+
             videoPlayerProperties = null;
         }

@@ -817,7 +938,7 @@
         videoPlayer.addEventListener(ProgressEvent.PROGRESS, dispatchEvent);
         videoPlayer.addEventListener(fl.video.VideoEvent.READY, videoPlayer_readyHandler);
         videoPlayer.addEventListener(fl.video.VideoEvent.STATE_CHANGE, videoPlayer_stateChangeHandler);
-
+
         addChild(videoPlayer);

         dispatchEvent(new Event("playheadTimeChanged"));
@@ -830,17 +951,17 @@
     override protected function measure() : void
     {
         super.measure();
-
+
         var vw:Number = videoPlayer.videoWidth;
         var vh:Number = videoPlayer.videoHeight;
-
+
         measuredWidth = vw;
         measuredHeight = vh;
-
+
         // Determine whether 'width' and 'height' have been set.
         var bExplicitWidth:Boolean = !isNaN(explicitWidth);
         var bExplicitHeight:Boolean = !isNaN(explicitHeight);
-
+
         // If only one has been set, calculate the other based on aspect ratio.
         if (_maintainAspectRatio && (bExplicitWidth || bExplicitHeight))
         {
@@ -944,7 +1065,7 @@
             // play2();
             var streamingSource:StreamingVideoSource = source as StreamingVideoSource;
             var flvSource:DynamicStreamItem;
-
+
             // if paused, pass in null as the flvSource.  Otherwise, calling
             // play(source) will reset the stream back to zero.  To restart the
             // stream where it was paused, one needs to call play(null).
@@ -961,14 +1082,14 @@
             {
                 flvSource =  new DynamicStreamItem();
                 sourceLastPlayed = source;
-
+
                 flvSource.uri = streamingSource.serverURI;

                 // if dealing with a live streaming video, set start = -1
                 // otherwise we don't worry about the start parameter
                 if (streamingSource.live)
                     flvSource.start = -1;
-
+
                 var n:int = streamingSource.streamItems.length;
                 var item:StreamItem;
                 for (var i:int = 0; i < n; i++)
@@ -996,7 +1117,7 @@
         {
             // The progressive case
             var sourceString:String;
-
+
             // if paused, pass in null as the flvSource.  Otherwise, calling
             // play(source) will reset the stream back to zero.  To restart the
             // stream where it was paused, one needs to call play(null).
@@ -1055,7 +1176,7 @@

         setPlaying(false);
     }
-
+
     /**
      *  Seeks to given second in video. If video is playing,
      *  continues playing from that point. If video is paused, seek to
@@ -1139,6 +1260,44 @@

     /**
      *  @private
+     *  Keeps track of whether we are on the display list or not
+     */
+    private var _isOnDisplayList:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private function addedToStageHandler(event:Event):void
+    {
+        _isOnDisplayList = true;
+
+        // if visiblity/onstage shouldn't effect whether we are playing or not, just return
+        if (playWhenHidden)
+            return;
+
+        // if we should start autoPlaying and we're not, let's do that
+        if (effectiveAutoPlay && !playing)
+            play();
+    }
+
+    /**
+     *  @private
+     */
+    private function removedFromStageHandler(event:Event):void
+    {
+        _isOnDisplayList = false;
+
+        // if visiblity/onstage shouldn't effect whether we are playing or not, just return
+        if (playWhenHidden)
+            return;
+
+        // if we're removed from the stage and we're playing, let's pause
+        if (playing)
+            pause();
+    }
+
+    /**
+     *  @private
      */
     private function videoPlayer_autoRewoundHandler(event:fl.video.VideoEvent):void
     {
@@ -1261,20 +1420,20 @@
         //ifdef DEBUG
         //debugTrace("connectToURL(" + url + ")");
         //endif
-
+
         // init
         initOtherInfo();
         _contentPath = url;
         if (_contentPath == null || _contentPath == "") {
             throw new VideoError(VideoError.INVALID_SOURCE);
         }
-
+
         // parse URL to determine what to do with it
         var parseResults:ParseResults = parseURL(_contentPath);
         if (parseResults.streamName == null || parseResults.streamName == "") {
             throw new VideoError(VideoError.INVALID_SOURCE, url);
         }
-
+
         // connect to either rtmp or http or download and parse smil
         var canReuse:Boolean;
         if (parseResults.isRTMP) {
@@ -1295,9 +1454,9 @@
         } else {
             var name:String = parseResults.streamName;
             if ( name.indexOf("?") < 0 &&
-                 (name.length < 4 || name.slice(-4).toLowerCase() != ".txt") &&
-                 (name.length < 4 || name.slice(-4).toLowerCase() != ".xml") &&
-                 (name.length < 5 || name.slice(-5).toLowerCase() != ".smil") ) {
+                (name.length < 4 || name.slice(-4).toLowerCase() != ".txt") &&
+                (name.length < 4 || name.slice(-4).toLowerCase() != ".xml") &&
+                (name.length < 5 || name.slice(-5).toLowerCase() != ".smil") ) {
                 canReuse = canReuseOldConnection(parseResults);
                 _isRTMP = false;
                 _streamName = name;


- bugfix: CSS transitions didn't properly work for relative values (i.e., percentages)

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@667 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/css/CSSProperty.as
+++ src/reprise/css/CSSProperty.as
@@ -222,11 +222,11 @@
 			{
 				return m_specifiedValue is Number && m_specifiedValue || 0;
 			}
-			if (m_calculationResultsCache[reference])
-			{
-				return m_calculationResultsCache[reference];
-			}
-			return m_calculationResultsCache[reference] =
+			if (m_calculationResultsCache[reference+m_specifiedValue])
+			{
+				return m_calculationResultsCache[reference+m_specifiedValue];
+			}
+			return m_calculationResultsCache[reference+m_specifiedValue] =
 				resolveCalculation(reference, context);
 		}

@@ -308,6 +308,7 @@
 		protected function resolveCalculation(
 			reference : Number, context : ICSSCalculationContext = null) : Number
 		{
+			log(m_specifiedValue, reference);
 			return m_calculation.resolve(reference, context);
 		}
 	}


Fixed a bug that caused DocumentView to try to perform element validation after it has been removed from stage

--- src/reprise/ui/DocumentView.as
+++ src/reprise/ui/DocumentView.as
@@ -272,7 +272,7 @@

 		reprise function markChildAsInvalid(child : UIObject) : void
 		{
-			if (m_invalidChildren.length == 0)
+			if (m_invalidChildren.length == 0 && stage != null)
 			{
 				addEventListener(Event.ENTER_FRAME, self_enterFrame, false, 0, true);
 			}


escape() has nothing to do with the unescape() just below it, it's used
to prepare messages before handing them off to a MessageFormat.
We don't have those in actionscript, so we don't need to prepare.

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

--- src/as/com/threerings/util/MessageBundle.as
+++ src/as/com/threerings/util/MessageBundle.as
@@ -180,7 +180,7 @@
             return (key + args);
         }

-        return mx.utils.StringUtil.substitute(escape(msg), args);
+        return mx.utils.StringUtil.substitute(msg, args);
     }

     /**
@@ -356,19 +356,6 @@
     }

     /**
-     * Used to escape single quotes so that they are not interpreted by
-     * {@link MessageFormat}. As we assume all single quotes are to be
-     * escaped, we cannot use the characters { and
-     * } in our translation strings, but this is a small
-     * price to pay to have to differentiate between messages that will
-     * and won't eventually be parsed by a {@link MessageFormat} instance.
-     */
-    public static function escape (val :String) :String
-    {
-        return val.replace("'", "''");
-    }
-
-    /**
      * Unescapes characters that are escaped in a call to compose.
      */
     public static function unescape (val :String) :String


Oop, we'll want to immediately Stringify any args passed to our constructor,
as well.

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

--- src/as/com/threerings/util/StringBuilder.as
+++ src/as/com/threerings/util/StringBuilder.as
@@ -4,7 +4,7 @@
 {
     public function StringBuilder (... args)
     {
-        _array = args;
+        append.apply(this, args);
     }

     /**
@@ -28,6 +28,6 @@
     }

     /** Our array in which we place all arguments. */
-    protected var _array :Array;
+    protected var _array :Array = [];
 }
 }


comment updates

comment updates

--- dorkbots/dorkbots_ui/TruncateTextField.as
+++ dorkbots/dorkbots_ui/TruncateTextField.as
@@ -9,7 +9,7 @@

 		}

-		public static function truncateText( textField:TextField, addElipsis:Boolean = true, minimizeLines:uint = 0, ellipsis:String = "\u2026" ):uint
+		public static function truncateText( textField:TextField, addEllipsis:Boolean = true, minimizeLines:uint = 0, ellipsis:String = "\u2026" ):uint
 		{
 			var tempTextField:TextField;

@@ -26,27 +26,42 @@
 			}

 			// Remove any empty spaces and periods at the end
-			while(tempTextField.text.charAt(tempTextField.text.length - 1) == " " || tempTextField.text.charAt(tempTextField.text.length - 1) == ".")
-			{
-				characterRemoveCnt++;
-				tempTextField.text = tempTextField.text.slice(0, -1);
+			var continueEndTidying:Boolean = true;
+			while(continueEndTidying)
+			{
+				continueEndTidying = false;
+
+				if (tempTextField.text.charAt(tempTextField.text.length - 1) == " ") continueEndTidying = true;
+				// remove any periods if we are adding ellipsis
+				if (addEllipsis && tempTextField.text.charAt(tempTextField.text.length - 1) == ".") continueEndTidying = true;
+
+				if (continueEndTidying)
+				{
+					characterRemoveCnt++;
+					tempTextField.text = tempTextField.text.slice(0, -1);
+				}
+
 				// just incase, because while loops make me nervous
 				if (tempTextField.text.length <= 0) break;
 			}

-			tempTextField.appendText( ellipsis );
-
-			if (tempTextField.numLines > 1)
-			{
-				// check again, for some reason, adding the ellipsis can increase number of lines
-				while( textOverflowing( tempTextField, minimizeLines, ellipsis ) )
-				{
-					characterRemoveCnt++;
-					tempTextField.text = tempTextField.text.substr( 0, tempTextField.text.length - ellipsis.length - 1 );
-				}
-			}
-
-			tempTextField.appendText( ellipsis );
+			// add ellipsis
+			if (ellipsis)
+			{
+				tempTextField.appendText( ellipsis );
+
+				if (tempTextField.numLines > 1)
+				{
+					// check again, for some reason, adding the ellipsis can increase number of lines
+					while( textOverflowing( tempTextField, minimizeLines, ellipsis ) )
+					{
+						characterRemoveCnt++;
+						tempTextField.text = tempTextField.text.substr( 0, tempTextField.text.length - ellipsis.length - 1 );
+					}
+				}
+
+				tempTextField.appendText( ellipsis );
+			}

 			textField.text = tempTextField.text;

@@ -96,10 +111,10 @@
 		 * @param moreLink  Boolean value to show a "[more]" with a TextEvent (TextEvent.LINK) at the end of truncation.
 		 * This method is based on Michael Ritchie's work at http://thanksmister.com/2009/07/12/flex-truncating-html-text/
 		 * */
-		public static function truncateHTMLText(value:String, limit:int, ellipses:Boolean = true, moreLink:Boolean = true):String
+		public static function truncateHTMLText(value:String, limit:int, addEllipsis:Boolean = true, addMoreLink:Boolean = true):String
 		{
-			if (!ellipses) limit += 3;
-			if (!moreLink) limit += 6;
+			if (!addEllipsis) limit += 3;
+			if (!addMoreLink) limit += 6;

 			if(limit <= 0) return "";

@@ -192,11 +207,32 @@
 				if (result.length <= 0) break;
 			}

+			// Remove any empty spaces and periods at the end
+			var continueEndTidying:Boolean = true;
+			while(continueEndTidying)
+			{
+				continueEndTidying = false;
+
+				if (result.charAt(result.length - 1) == " ") continueEndTidying = true;
+				// remove any periods if we are adding ellipsis
+				if (addEllipsis && result.charAt(result.length - 1) == ".") continueEndTidying = true;
+
+				if (continueEndTidying)
+				{
+					result = result.slice(0, -1);
+				}
+
+				// just incase, because while loops make me nervous
+				if (result.length <= 0) break;
+			}
+
+
+
 			var pattern:RegExp = new RegExp("(.*?)(\\s*\.\.\.\\s*)([\</[a-z]*?\>\\s*$]+)", "i");

-			if(result.search(pattern) == -1 && ellipses) result += "...";
-
-			if (moreLink)
+			if(result.search(pattern) == -1 && addEllipsis) result += "...";
+
+			if (addMoreLink)
 			{
 				return (result +  " [more]");
 			}


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@1252246 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBaseAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBaseAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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.
 //
 ////////////////////////////////////////////////////////////////////////////////


partially fixed sysdelayclock tooltips

partially fixed sysdelayclock tooltips

--- src/Modules/SysDelayClock.as
+++ src/Modules/SysDelayClock.as
@@ -8,7 +8,7 @@
 	 */
 	public class SysDelayClock extends Module {

-		public var edgeLength:int;
+		public var edgeLength:int = 1;
 		protected var clockPeriod:int;
 		public function SysDelayClock(X:int, Y:int, EdgeLength:int = 1) {
 			super(X, Y, "SysClock", Module.CAT_TIME, 0, 1, 0);
@@ -23,7 +23,8 @@
 				return configuration = new Configuration(new Range(1, 63, edgeLength));
 			if (U.state.time.clockPeriod != clockPeriod) {
 				clockPeriod = U.state.time.clockPeriod;
-				configuration = new Configuration(new Range(1, clockPeriod - 1, Math.max(Math.min(edgeLength, clockPeriod - 1), 1)));
+				var initial:int = Math.max(Math.min(edgeLength, clockPeriod - 1), 1);
+				configuration = new Configuration(new Range(1, clockPeriod - 1, initial));
 			}
 			return configuration;
 		}
@@ -33,11 +34,15 @@
 		}

 		override public function renderDetails():String {
-			return "SYSCLK" + "\n"+U.state.time.clockPeriod+"\n"+edgeLength+"-"+(U.state.time.clockPeriod - edgeLength)+"\n\n" + drive(null);
+			return "SYSCLK" + "\n"+U.state.time.clockPeriod+"\n"+edgeLength+"-"+delayLength+"\n\n" + drive(null);
 		}

 		override public function getDescription():String {
-			return "Outputs "+EDGE+" for "+edgeLength+" ticks every "+configuration.value+" ticks, and "+NO_EDGE+" the rest of the time."
+			return "Outputs "+EDGE+" for "+edgeLength+" ticks every "+delayLength+" ticks, and "+NO_EDGE+" the rest of the time."
+		}
+
+		protected function get delayLength():int {
+			return Math.max(1, U.state.time.clockPeriod - edgeLength);
 		}

 		override public function drive(port:Port):Value {


Added NaN check on particle insert

Added NaN check on particle insert

git-svn-id: 6aa7ccb0a2048310a30f08a72aaff4ca39d980ed@163 91848ab2-c4ae-4e4f-8e6a-6a52ea0dccc3

--- flare.physics/flare/physics/NBodyForce.as
+++ flare.physics/flare/physics/NBodyForce.as
@@ -177,6 +177,9 @@
 		private function insert(p:Particle, n:QuadTreeNode,
 			x1:Number, y1:Number, x2:Number, y2:Number):void
 		{
+			// ignore particles with NaN coordinates
+			if (isNaN(p.x) || isNaN(p.y)) return;
+
 			// try to insert particle p at node n in the quadtree
         	// by construction, each leaf will contain either 1 or 0 particles
         	if ( n.hasChildren ) {


Tests: better comments

Tests: better comments

--- test/src/tests/ExtendConfigTopLevelTests.as
+++ test/src/tests/ExtendConfigTopLevelTests.as
@@ -65,8 +65,12 @@

 		//--- files

-		//file is an array, but unlike other arrays, it does not get merged,
+		//files is an array, but unlike other arrays, it does not get merged,
 		//so it should be tested as a special case
+
+		//the files array is not merged because the order elements in the array
+		//must be preserved, unlike other arrays which can be handled more
+		//leniently

 		[Test]
 		public function testFilesWithBaseOnly():void
@@ -139,7 +143,7 @@

 		//--- application

-		//application can be a string or a file, and it has special rules for
+		//application can be a string or an object, and it has special rules for
 		//merging

 		[Test]


Transferred from the Adobe Open Source Subversion Repository

Revision: 4205
Author:   clucier@adobe.com
Date:     2008-12-01T19:48:53.571431Z

Log Message:
-----------
Initial baselinePosition support for our new skinnable components.
QE Notes: Please wait until Evtim completes his baseline support in our new layouts to test.
Doc Notes: None
Reviewer: Glenn, Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxHSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.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/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as
@@ -299,7 +299,7 @@
             invalidateDisplayList();
         }
     }
-
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: GraphicElement
@@ -440,6 +440,26 @@
     protected function invalidateTextLines(cause:String):void
     {
     }
+
+    /**
+     * @private
+     * Used to ensure baselinePosition will reflect something
+     * reasonable.
+     */
+    mx_internal function validateBaselinePosition():void
+    {
+        // Ensure we're validated and that we have something to
+        // compute our baseline from.
+        var isEmpty:Boolean = (text == "");
+        text = isEmpty ? "Wj" : text;
+
+        if (mx_internal::invalidatePropertiesFlag || mx_internal::invalidateSizeFlag ||
+            mx_internal::invalidateDisplayListFlag || isEmpty)
+        {
+            validateNow();
+            text = isEmpty ? "" : text;
+        }
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 13666
Author:   jimurphy@adobe.com
Date:     2010-01-20T19:05:30.983340Z

Log Message:
-----------
Merge /branches/4.0.0 revs 13595,13601,13613,13614,13615,13616,13619,13638,13644,13646,13647,13652,13653,13654,13665 -> trunk

checkintests pass

4.0.0 changes:
------------------------------------------------------------------------
r13665 | jimurphy@adobe.com

remove the call to clean-temp before the package staging starts.  Removing the temp directory before the copy was removing the config updates that happen before this target is called.
SDK-25160

------------------------------------------------------------------------
r13595 | jimurphy@adobe.com | 2010-01-18 18:24:33 -0500 (Mon, 18 Jan 2010) | 15 lines

split airframework from airspark docs
-delete airframework/bundles/[locale]/docs/spark xml's
-add airspark/bundles/[locale]/docs/spark xml's
-added airspark/bundles/en_US/ english properties
-modified airspark/build to:
  -use en_US properties for each of the locales until localized
  -use the localized spark doc files for each locale in the fat-swc target

SDK-25065
------------------------------------------------------------------------

------------------------------------------------------------------------
r13601 | preilly@adobe.com | 2010-01-18 19:54:16 -0500 (Mon, 18 Jan 2010) | 25 lines

* Fixed a regression caused by revision 13531.

SDK-25115 Code-level description of changes:

  StyleDef.java

    Modified extractImports() by adding a "null" value check for
    ClassReferences.

    Modified processReference() to use Reference's updated
    constructor.

  Reference.java

    Modified constructor by adding a isClassReference parameter.

    Removed setClassReference(), because it's no longer used.

------------------------------------------------------------------------

------------------------------------------------------------------------
r13613 | jimurphy@adobe.com | 2010-01-18 22:23:05 -0500 (Mon, 18 Jan 2010) | 14 lines

Integration:
from branch: releases/ct/yuki/sonoma/...
afe.jar: 62.418002
rideau.jar: 62.417355

https://bugs.adobe.com/jira/browse/SDK-25018
SDK-25018 https://bugs.adobe.com/jira/browse/SDK-25012
SDK-25012
------------------------------------------------------------------------

------------------------------------------------------------------------
r13614 | jimurphy@adobe.com | 2010-01-18 22:56:49 -0500 (Mon, 18 Jan 2010) | 9 lines

additional update for airspark, added packages.dita to svn and instead of unzipping properties from airspark_rb the locales will simply use the files from the en_US directory until the localized files are submitted.

SDK-25065
------------------------------------------------------------------------

------------------------------------------------------------------------
r13615 | jimurphy@adobe.com | 2010-01-18 23:59:14 -0500 (Mon, 18 Jan 2010) | 12 lines

fix airframework/build.xml so the en_US _rb does not become corrupt when the other.locales target is run.
-removed the redundant en_US call in the other.locales target
-added a clean for locales that will only remove the locale being built before rebuild - not all of the locales
-add updated dita that does not contain spark references

------------------------------------------------------------------------

------------------------------------------------------------------------
r13616 | rfrishbe@adobe.com | 2010-01-19 00:01:44 -0500 (Tue, 19 Jan 2010) | 10 lines

Fixing a VideoPlayer bug, SDK-25116 (When switching the video source while another video is loading, the switch doesn't always work).  It's similar to SDK-24933.  In the previous fix, we cleaned up the asynchronous load when we decided we wanted to just play the video.  However, we should also clean up this asynchronous load when the source changes.  This code could be refactored later, and I put a TODO in for that.
SDK-25116 SDK-24933
Also, I'm cleaning up some docs around some scenarios when the source is switched that explicitly won't work.  At some point, we could make these work, but I don't think it's worth the extra effort/code given how likely these are that a developer or user would run in to them.

SDK-25116
------------------------------------------------------------------------

------------------------------------------------------------------------
r13619 | egeorgie@adobe.com | 2010-01-19 01:23:05 -0500 (Tue, 19 Jan 2010) | 11 lines

Fix bug: Scaling a DateChooser inside a Canvas causes RTE http://bugs.adobe.com/jira/browse/SDK-25087
SDK-25087
The offending code was in the PostScaleAdapter - missing check for zero when dividing by the scale.

SDK-25087
------------------------------------------------------------------------

------------------------------------------------------------------------
r13638 | jimurphy@adobe.com | 2010-01-19 17:51:32 -0500 (Tue, 19 Jan 2010) | 14 lines

update to ensure fat-swcs contain a proper packages.dita file.
-removed all packages.dita files from all langs where it was checked in
-at the end of asdoc task we now copy the packages.dita out to the en_US project dir being built.  This is where the fat-swc task will pick up this file and place it in the docs directory of the _rb.swc
-had to change the order of the build process slightly - old order: ant clean main other.locales doc - new order: ant clean main doc other.locales
 - I removed other.locales from main in the root/build.xml and made it it's own task and also removed the property locales.  so to build other.locales, the doc target needs to run first (will add a depends at some point).
 -in the internal build.xml I have changed to use the new order

------------------------------------------------------------------------

------------------------------------------------------------------------
r13644 | jimurphy@adobe.com | 2010-01-19 18:55:59 -0500 (Tue, 19 Jan 2010) | 11 lines

fix the build.
-make sure the bundles do not get deleted before they are about to be updated, this holds especially true for swcs we are checking in
-make sure we don't try and rebuild osmf.swc as it should not change b/c it is in src

------------------------------------------------------------------------

------------------------------------------------------------------------
r13646 | jimurphy@adobe.com | 2010-01-19 19:29:21 -0500 (Tue, 19 Jan 2010) | 8 lines

fix the build take 2  Don't call other.locales for osmf since there aren't any other locales to build - I am hoping this is why the osmf_rb is losing the catalog

------------------------------------------------------------------------

------------------------------------------------------------------------
r13647 | jimurphy@adobe.com | 2010-01-19 20:04:22 -0500 (Tue, 19 Jan 2010) | 8 lines

this should actually fix the build - call the modified main target to call the bundle task for osmf and actually make the call from frameworks/build.xml

------------------------------------------------------------------------

------------------------------------------------------------------------
r13652 | rfrishbe@adobe.com | 2010-01-19 21:31:18 -0500 (Tue, 19 Jan 2010) | 8 lines

Fixing an MX TextArea bug.  It's caused by MX ScrollControlBase pushing the enabled property down in to the BorderSkin and also caused by some enabled/alpha issues in GroupBase.  For now, we're fixing the ScrollControlBase issue and no longer pushing the enabled property down in to the skin.

SDK-25109
------------------------------------------------------------------------

------------------------------------------------------------------------
r13653 | jimurphy@adobe.com | 2010-01-19 22:12:19 -0500 (Tue, 19 Jan 2010) | 11 lines

fix airspark_rb so it is localized properly.
-point to framework/bundles/[locale] localized files instead of using the english files we had in arispark
-remove en_US property files from airspark

------------------------------------------------------------------------

------------------------------------------------------------------------
r13654 | aharui@adobe.com | 2010-01-19 23:44:34 -0500 (Tue, 19 Jan 2010) | 8 lines

Replace an IPE defense I took out in svn 10058

SDK-25081
------------------------------------------------------------------------

Modified Paths:
--------------
104 paths were modified

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

--- frameworks/projects/framework/src/mx/containers/utilityClasses/PostScaleAdapter.as
+++ frameworks/projects/framework/src/mx/containers/utilityClasses/PostScaleAdapter.as
@@ -175,7 +175,7 @@
      */
     public function set explicitHeight(value:Number):void
     {
-        obj.explicitHeight = value / Math.abs(obj.scaleY);
+        obj.explicitHeight = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
     }

     //----------------------------------
@@ -268,7 +268,7 @@
      */
     public function set explicitWidth(value:Number):void
     {
-        obj.explicitWidth = value / Math.abs(obj.scaleX);
+        obj.explicitWidth = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
     }

     //----------------------------------
@@ -402,7 +402,7 @@
      */
     public function set measuredMinHeight(value:Number):void
     {
-        obj.measuredMinHeight = value / Math.abs(obj.scaleY);
+        obj.measuredMinHeight = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
     }

     //----------------------------------
@@ -427,7 +427,7 @@
      */
     public function set measuredMinWidth(value:Number):void
     {
-        obj.measuredMinWidth = value / Math.abs(obj.scaleX);
+        obj.measuredMinWidth = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
     }

     //----------------------------------
@@ -754,9 +754,9 @@
      */
     public function setActualSize(newWidth:Number, newHeight:Number):void
     {
-        obj.setActualSize(newWidth / Math.abs(obj.scaleX), newHeight / Math.abs(obj.scaleY));
-    }
-
+        obj.setActualSize(obj.scaleX == 0 ? 0 : newWidth / Math.abs(obj.scaleX),
+                          obj.scaleY == 0 ? 0 : newHeight / Math.abs(obj.scaleY));
+    }

     //--------------------------------------------------------------------------
     //
@@ -960,7 +960,7 @@
     }
     public function set width(value:Number):void
     {
-        obj.width = value / Math.abs(obj.scaleX);
+        obj.width = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
     }

     /**
@@ -977,7 +977,7 @@
     }
     public function set height(value:Number):void
     {
-        obj.height = value / Math.abs(obj.scaleY);
+        obj.height = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 18357
Author:   jasonsj@adobe.com
Date:     2010-10-28T22:43:40.124825Z

Log Message:
-----------
Mobile Theme feature work:
Implemented borderVisible and prompt for mobile TextInputSkin
Fixed focus exclusions for CheckBox and RadioButton
Fixed promptDisplay bug in TextInput
Moved textShadowAlpha and textShadowColor to BasicInheritingTextStyles from ActionBar and Button
Added leading and letterSpacing to BasicInheritingTextStyles

QE notes: Update mustella bitmaps for Button and RadioButton
Doc notes:
Bugs:
SDK-28239 Fixed visuals for Button and RadioButton skin
Reviewer: gruehle, aharui
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/assets/RadioButton_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/Button_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/RadioButton_upSelected.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/styles/metadata/StyleableTextFieldTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/Button_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/RadioButton_down.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/CheckBoxSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/RadioButton_downSelected.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/assets/CheckBox_up.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/RadioButtonSkin.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as
@@ -17,7 +17,6 @@
 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.events.FocusEvent;
-import flash.events.MouseEvent;
 import flash.system.Capabilities;

 import flashx.textLayout.elements.TextFlow;
@@ -28,7 +27,6 @@
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
 import mx.events.TouchInteractionEvent;
-import mx.events.SandboxMouseEvent;
 import mx.managers.IFocusManagerComponent;
 import mx.utils.BitFlagUtil;

@@ -1235,7 +1233,7 @@
                 PROMPT_TEXT_PROPERTY_FLAG))
             {
                 newPromptDisplayProperties.prompt =
-                    textDisplay.text;
+                    promptDisplay.text;
             }
             promptDisplayProperties = newPromptDisplayProperties;
         }


ie textdecoder

ie textdecoder

--- src/flash/utils/ByteArray.as
+++ src/flash/utils/ByteArray.as
@@ -154,11 +154,15 @@
 		}

 		public function readMultiByte(length:uint, charSet:String):String  {
-			var decoder:TextDecoder = new TextDecoder(charSet);
 			var u8:Uint8Array = new Uint8Array(length);
 			u8.set(new Uint8Array(dataView.buffer.slice(_position, _position + length)));
-			var str:String=decoder.decode(u8)
 			_position += length;
+			try{
+				var decoder:TextDecoder = new TextDecoder(charSet);
+				var str:String = decoder.decode(u8);
+			}catch(err:Object){
+				str=String.fromCharCode.apply(null,u8);
+			}
 			return str;
 		}

@@ -244,7 +248,8 @@
 		}

 		public function clear():void  {
-
+			position = 0;
+			length = 0;
 		}

 		public function atomicCompareAndSwapIntAt(param1:int, param2:int, param3:int):int  { return 0 }


Don't spend time updating single-frame movies

--- runtime/src/main/as/flump/display/Movie.as
+++ runtime/src/main/as/flump/display/Movie.as
@@ -130,30 +130,32 @@
         if (dt < 0) throw new Error("Invalid time [dt=" + dt + "]");
         if (!_playing) return;

-        _playTime += dt;
-        var actualPlaytime :Number = _playTime;
-        if (_playTime >= _duration) _playTime %= _duration;
-
-        // If _playTime is very close to _duration, rounding error can cause us to
-        // land on lastFrame + 1. Protect against that.
-        var newFrame :int = clamp(int(_playTime * _frameRate), 0, _numFrames - 1);
-
-        // If the update crosses or goes to the stopFrame:
-        // go to the stopFrame, stop the movie, clear the stopFrame
-        if (_stopFrame != NO_FRAME) {
-            // how many frames remain to the stopframe?
-            var framesRemaining :int =
-                (_frame <= _stopFrame ? _stopFrame - _frame : _numFrames - _frame + _stopFrame);
-            var framesElapsed :int = int(actualPlaytime * _frameRate) - _frame;
-            if (framesElapsed >= framesRemaining) {
-                _playing = false;
-                newFrame = _stopFrame;
-                _stopFrame = NO_FRAME;
-            }
-        }
-        updateFrame(newFrame, dt);
-
-        for (var ii :int = 0; ii < this.numChildren; ++ii) {
+        if (_numFrames > 1) {
+            _playTime += dt;
+            var actualPlaytime :Number = _playTime;
+            if (_playTime >= _duration) _playTime %= _duration;
+
+            // If _playTime is very close to _duration, rounding error can cause us to
+            // land on lastFrame + 1. Protect against that.
+            var newFrame :int = clamp(int(_playTime * _frameRate), 0, _numFrames - 1);
+
+            // If the update crosses or goes to the stopFrame:
+            // go to the stopFrame, stop the movie, clear the stopFrame
+            if (_stopFrame != NO_FRAME) {
+                // how many frames remain to the stopframe?
+                var framesRemaining :int =
+                    (_frame <= _stopFrame ? _stopFrame - _frame : _numFrames - _frame + _stopFrame);
+                var framesElapsed :int = int(actualPlaytime * _frameRate) - _frame;
+                if (framesElapsed >= framesRemaining) {
+                    _playing = false;
+                    newFrame = _stopFrame;
+                    _stopFrame = NO_FRAME;
+                }
+            }
+            updateFrame(newFrame, dt);
+        }
+
+        for (var ii :int = this.numChildren - 1; ii >= 0; --ii) {
             var child :DisplayObject = getChildAt(ii);
             if (child is Movie) {
                 Movie(child).advanceTime(dt);


test rev

test rev

--- GA_AS3/src/com/google/analytics/GATracker.as
+++ GA_AS3/src/com/google/analytics/GATracker.as
@@ -30,6 +30,7 @@
     import com.google.analytics.events.MessageEvent;
     import com.google.analytics.external.HTMLDOM;
     import com.google.analytics.utils.Environment;
+    import com.google.analytics.utils.Version;
     import com.google.analytics.v4.Bridge;
     import com.google.analytics.v4.GoogleAnalyticsAPI;
     import com.google.analytics.v4.Tracker;
@@ -57,11 +58,14 @@
         * We mainly use it for internal test and it's basically a factory.
         *
         */
-        public function GATracker( display:DisplayObject )
+        public function GATracker( display:DisplayObject, debugmode:Boolean = false )
         {
             _display   = display;
-            debug.layout = new Layout( _display );
-            debug.active = true;
+            if( debugmode )
+            {
+                debug.layout = new Layout( _display );
+                debug.active = debugmode;
+            }

             /* note:
                for unit testing and to avoid 2 different branches AIR/Flash
@@ -82,7 +86,9 @@
         * note:
         * each components will have also their own version
         */
-        public static var version:String = "0.5.0." + "$Rev$ ".split( " " )[1];
+        public static var version:Version = new Version();
+        include "version.properties"
+        version.revision = "$Rev$ ".split( " " )[1];

         private function _onInfo( event:MessageEvent ):void
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 10695
Author:   clucier@adobe.com
Date:     2009-09-29T20:42:19.188738Z

Log Message:
-----------
Per Ely, relaxing the type for the skin property on SkinnableComponent.

QE notes: None
Doc notes: None
Bugs: SDK-23046
Reviewer: Deepa
Tests run: Checkin
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -55,8 +55,8 @@
 [Style(name="errorSkin", type="Class")]

 /**
- *  Name of the skin class to use for this component. The skin must be a class that extends
- *  the spark.components.supportClasses.Skin class.
+ *  Name of the skin class to use for this component. The skin must be a class
+ *  that extends UIComponent.
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -91,7 +91,8 @@

 /**
  *  The SkinnableComponent class defines the base class for skinnable components.
- *  The skins used by a SkinnableComponent class are child classes of the Skin class.
+ *  The skins used by a SkinnableComponent class are typically child classes of
+ *  the Skin class.
  *
  *
Associate a skin class with a component class by setting the skinClass style property of the
  *  component class. You can set the skinClass property in CSS, as the following example shows:

@@ -166,7 +167,7 @@
      * @private
      * Storage for skin instance
      */
-    private var _skin:Skin;
+    private var _skin:UIComponent;

     [Bindable("skinChanged")]

@@ -180,7 +181,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function get skin():Skin
+    public function get skin():UIComponent
     {
         return _skin;
     }
@@ -190,7 +191,7 @@
      *  Setter for the skin instance.  This is so the bindable event
      *  is dispatched
      */
-    private function setSkin(value:Skin):void
+    private function setSkin(value:UIComponent):void
     {
         if (value === _skin)
            return;
@@ -533,7 +534,7 @@
         var skinClassFactory:IFactory = getStyle("skinFactory") as IFactory;

         if (skinClassFactory)
-            setSkin( skinClassFactory.newInstance() as Skin );
+            setSkin( skinClassFactory.newInstance() as UIComponent );

         // Class
         if (!skin)