Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/containers/GridRow.as
+++ frameworks/projects/mx/src/mx/containers/GridRow.as
@@ -0,0 +1,595 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers
+{
+
+import flash.display.DisplayObject;
+import mx.containers.gridClasses.GridColumnInfo;
+import mx.containers.gridClasses.GridRowInfo;
+import mx.containers.utilityClasses.Flex;
+import mx.core.EdgeMetrics;
+import mx.core.ScrollPolicy;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+/**
+ *  Horizontal alignment of children in the container.
+ *  Possible values are "left", "center",
+ *  and "right".
+ *  The default value is "left".
+ */
+[Style(name="horizontalAlign", type="String", enumeration="left,center,right", inherit="no")]
+
+/**
+ *  Vertical alignment of children in the container.
+ *  Possible values are "top", "middle",
+ *  and "bottom".
+ *  The default value is "top".
+ */
+[Style(name="verticalAlign", type="String", enumeration="bottom,middle,top", inherit="no")]
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="clipContent", kind="property")]
+[Exclude(name="direction", kind="property")]
+[Exclude(name="focusEnabled", kind="property")]
+[Exclude(name="focusManager", kind="property")]
+[Exclude(name="focusPane", kind="property")]
+[Exclude(name="horizontalLineScrollSize", kind="property")]
+[Exclude(name="horizontalPageScrollSize", kind="property")]
+[Exclude(name="horizontalScrollBar", kind="property")]
+[Exclude(name="horizontalScrollPolicy", kind="property")]
+[Exclude(name="horizontalScrollPosition", kind="property")]
+[Exclude(name="maxHorizontalScrollPosition", kind="property")]
+[Exclude(name="maxVerticalScrollPosition", kind="property")]
+[Exclude(name="mouseFocusEnabled", kind="property")]
+[Exclude(name="verticalLineScrollSize", kind="property")]
+[Exclude(name="verticalPageScrollSize", kind="property")]
+[Exclude(name="verticalScrollBar", kind="property")]
+[Exclude(name="verticalScrollPolicy", kind="property")]
+[Exclude(name="verticalScrollPosition", kind="property")]
+
+[Exclude(name="adjustFocusRect", kind="method")]
+[Exclude(name="getFocus", kind="method")]
+[Exclude(name="isOurFocus", kind="method")]
+[Exclude(name="setFocus", kind="method")]
+
+[Exclude(name="focusIn", kind="event")]
+[Exclude(name="focusOut", kind="event")]
+[Exclude(name="move", kind="event")]
+[Exclude(name="scroll", kind="event")]
+
+[Exclude(name="focusBlendMode", kind="style")]
+[Exclude(name="focusSkin", kind="style")]
+[Exclude(name="focusThickness", kind="style")]
+[Exclude(name="horizontalGap", kind="style")]
+[Exclude(name="horizontalScrollBarStyleName", kind="style")]
+[Exclude(name="verticalGap", kind="style")]
+[Exclude(name="verticalScrollBarStyleName", kind="style")]
+
+[Exclude(name="focusInEffect", kind="effect")]
+[Exclude(name="focusOutEffect", kind="effect")]
+[Exclude(name="moveEffect", kind="effect")]
+
+/**
+ *  The GridRow container defines a row in a Grid container, and contains
+ *  GridCell containers.
+ *
+ *
GridRow containers have the following default sizing characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           Height of each row and each cell
+ *           The default or explicit height of the tallest item in the row. If a GridItem container does not
+ *               have an explicit size, its default height is the default or explicit height of the child in the cell.
+ *

+ *

+ *           Width of each column and each cell
+ *           The default or explicit width of the widest item in the column. If a GridItem container does not have an explicit
+ *               width, its default width is the default or explicit width of the child in the cell.
+ *

+ *

+ *           Gap between rows and columns
+ *           Determined by the horizontalGap and verticalGap properties of the Grid class. The default value for both
+ *               gaps is 6 pixels.
+ *

+ *

+ *           Default padding
+ *           0 pixels for the top, bottom, left, and right values, for all three container classes.
+ *

+ *

+ *
+ *  @mxml
+ *
+ *
The <mx:GridRow> must be a child of the
+ *  <mx:Grid> tag, and has one or more child
+ *  <mx:GridItem> tags that define the grid cells.

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

+ *
+ *

+ *  <mx:Grid>
+ *    <mx:GridRow
+ *    Styles
+ *      horizontalAlign="left|center|right"
+ *      verticalAlign="top|middle|bottom"
+ *    >
+ *      <mx:GridItem
+ *        child components
+ *      </mx:GridItem>
+ *      ...
+ *    </mx:GridRow>
+ *    ...
+ *  </mx:Grid>
+ *

+ *
+ *  @see mx.containers.Grid
+ *  @see mx.containers.GridItem
+ *
+ *  @includeExample examples/GridLayoutExample.mxml
+ */
+public class GridRow extends HBox
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function GridRow()
+    {
+        super();
+
+        // Set this to false so Container doesn't clip.
+        super.clipContent = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Width of columns in the row.
+     */
+    internal var columnWidths:Array /* of GridColumnInfo */;
+
+    /**
+     *  @private
+     *  Height of rows.
+     */
+    internal var rowHeights:Array /* of GridRowInfo */;
+
+    /**
+     *  @private
+     *  Index of this row.
+     */
+    internal var rowIndex:int = 0;
+
+    /**
+     *  @private
+     */
+    internal var numGridItems:int;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  clipContent
+    //----------------------------------
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  @private
+     */
+    override public function get clipContent():Boolean
+    {
+        return false;
+    }
+
+    /**
+     *  @private
+     *  Don't allow user to set clipContent.
+     *  The Grid will clip all GridItems, if necessary.
+     *  We don't want GridRows to do clipping, because GridItems with
+     *  rowSpan > 1 will extend outside the borders of the GridRow.
+     */
+    override public function set clipContent(value:Boolean):void
+    {
+    }
+
+    //----------------------------------
+    //  horizontalScrollPolicy
+    //----------------------------------
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  @private
+     */
+    override public function get horizontalScrollPolicy():String
+    {
+        return ScrollPolicy.OFF;
+    }
+
+    /**
+     *  @private
+     *  Don't allow user to set horizontalScrollPolicy.
+     */
+    override public function set horizontalScrollPolicy(value:String):void
+    {
+    }
+
+    //----------------------------------
+    //  verticalScrollPolicy
+    //----------------------------------
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  @private
+     */
+    override public function get verticalScrollPolicy():String
+    {
+        return ScrollPolicy.OFF;
+    }
+
+    /**
+     *  @private
+     *  Don't allow user to set verticalScrollPolicy.
+     */
+    override public function set verticalScrollPolicy(value:String):void
+    {
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: DisplayObjectContainer
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  If the child index of a row item is changed, we need to recompute
+     *  the column size and arrange children in proper order.
+     *  Hence invalidate the size and layout of the Grid.
+     */
+    override public function setChildIndex(child:DisplayObject,
+                                           newIndex:int):void
+    {
+        super.setChildIndex(child, newIndex);
+
+        Grid(parent).invalidateSize();
+        Grid(parent).invalidateDisplayList();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  If something causes a GridRow's measurements to change,
+     *  this function is called.
+     *  Ordinarily, this function registers the object with the
+     *  layout manager, so that measure is called later.
+     *  For GridRows, we can't do measurement until after the parent Grid
+     *  has done its measurement.
+     *  Therefore, we register the parent Grid with the layout manager.
+     *  The Grid.measure() contains code that calls measure()
+     *  on each child GridRow.
+     */
+    override public function invalidateSize():void
+    {
+        super.invalidateSize();
+        if (parent)
+            Grid(parent).invalidateSize();
+    }
+
+    /**
+     *  @private
+     */
+    override public function invalidateDisplayList():void
+    {
+        super.invalidateDisplayList();
+        if (parent)
+            Grid(parent).invalidateDisplayList();
+    }
+
+    /**
+     *  Sets the size and position of each child of the GridRow container.
+     *  For more information about the Grid layout algorithm,
+     *  see the Grid.updateDisplayList()
+     *  method.
+     *
+     *
You should not call this method directly.
+     *  The Flex LayoutManager calls it at the appropriate time.
+     *  At application startup, the Flex LayoutManager calls the
+     *  updateDisplayList() method on every component,
+     *  starting with the root and working downward.

+     *
+     *
This is an advanced method for use in subclassing.
+     *  If you override this method, your implementation should call the
+     *  super.updateDisplayList() method and call the
+     *  move() and setActualSize() methods
+     *  on each of the children.
+     *  For the purposes of performing layout, you should get the size
+     *  of this container from the unscaledWidth and
+     *  unscaledHeight properties, not the width
+     *  and height properties.
+     *  The width and height properties
+     *  do not take into account the value of the scaleX
+     *  and scaleY properties for this container.

+     *
+     *  @param unscaledWidth Specifies the width of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  scaleX property of the component.
+     *
+     *  @param unscaledHeight Specifies the height of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  scaleY property of the component.
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        // Don't do any layout at the usual time.
+        // Instead, we'll do our layout
+        // when Grid.updateDisplayList() calls GridRow.doRowLayout().
+    }
+
+    /**
+     *  @private
+     *  Use the horizontalGap from my parent grid;
+     *  ignore any horizontalGap that is set on the GridRow.
+     */
+    override public function getStyle(styleProp:String):*
+    {
+        return styleProp == "horizontalGap" && parent ?
+               Grid(parent).getStyle("horizontalGap") :
+               super.getStyle(styleProp);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Calculates the preferred, minimum and maximum sizes
+     *  of the GridRow container.
+     */
+    internal function updateRowMeasurements():void
+    {
+        var numChildren:Number = columnWidths.length;
+
+        var minWidth:Number = 0;
+        var preferredWidth:Number = 0;
+
+        for (var i:int = 0; i < numChildren; i++)
+        {
+            var child:GridColumnInfo = columnWidths[i];
+            minWidth += child.min;
+            preferredWidth += child.preferred;
+        }
+
+        var wPadding:Number =
+            mx_internal::layoutObject.widthPadding(numChildren);
+        var hPadding:Number = mx_internal::layoutObject.heightPadding(0);
+        var rowInfo:GridRowInfo = rowHeights[rowIndex];
+
+        measuredMinWidth = minWidth + wPadding;
+        measuredMinHeight = rowInfo.min + hPadding;
+        measuredWidth = preferredWidth + wPadding;
+        measuredHeight = rowInfo.preferred + hPadding;
+    }
+
+    /**
+     *  @private
+     */
+    internal function doRowLayout(unscaledWidth:Number,
+                                  unscaledHeight:Number):void
+    {
+        // Call layoutChrome() to size and position the border.
+        layoutChrome(unscaledWidth, unscaledHeight);
+
+        var n:Number = numChildren;
+        if (n == 0)
+            return;
+
+        // Block requeue-ing. No layout pass should
+        // result in the invalidation of your size and layout.
+        var oldSizeFlag:Boolean = invalidateSizeFlag;
+        var oldDisplayListFlag:Boolean = invalidateDisplayListFlag;
+        invalidateSizeFlag = true;
+        invalidateDisplayListFlag = true;
+
+        // Run the standard Flex layout algorithm to position the columns.
+        // We normally only run the Flex layout algorithm once, but we'll
+        // run it again if the min/max/prefWidth changes (which can happen
+        // if those values are set explicitly for this row).
+        if (parent.getChildIndex(this) == 0 ||
+            isNaN(columnWidths[0].x) ||
+            columnWidths.minWidth != minWidth ||
+            columnWidths.maxWidth != maxWidth ||
+            columnWidths.preferredWidth != getExplicitOrMeasuredWidth() ||
+            columnWidths.percentWidth != percentWidth ||
+            columnWidths.width != unscaledWidth ||
+            columnWidths.paddingLeft != getStyle("paddingLeft") ||
+            columnWidths.paddingRight != getStyle("paddingRight") ||
+            columnWidths.horizontalAlign != getStyle("horizontalAlign") ||
+            columnWidths.borderStyle != getStyle("borderStyle"))
+        {
+            calculateColumnWidths();
+            columnWidths.minWidth = minWidth;
+            columnWidths.maxWidth = maxWidth;
+            columnWidths.preferredWidth = getExplicitOrMeasuredWidth();
+            columnWidths.percentWidth = percentWidth;
+            columnWidths.width = unscaledWidth;
+            columnWidths.paddingLeft = getStyle("paddingLeft");
+            columnWidths.paddingRight = getStyle("paddingRight");
+            columnWidths.horizontalAlign = getStyle("horizontalAlign");
+            columnWidths.borderStyle = getStyle("borderStyle");
+        }
+
+        var vm:EdgeMetrics = viewMetricsAndPadding;
+
+        // Now position the actual child GridItem objects, based on the
+        // values that were stored in the rowHeights and columnWidths arrays.
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:GridItem = GridItem(getChildAt(i));
+            var colIndex:int = child.colIndex;
+            var x:Number = columnWidths[colIndex].x;
+            var y:Number = vm.top;
+            var percentHeight:Number = child.percentHeight;
+
+            var finalColIndex:int =
+                Math.min(colIndex + child.colSpan, columnWidths.length);
+            var finalCol:GridColumnInfo = columnWidths[finalColIndex - 1];
+            var w:Number = finalCol.x + finalCol.width - x;
+
+            var finalRowIndex:int =
+                Math.min(rowIndex + child.rowSpan, rowHeights.length);
+            var finalRow:GridRowInfo = rowHeights[finalRowIndex - 1];
+            var h:Number = finalRow.y + finalRow.height -
+                           rowHeights[rowIndex].y - vm.top - vm.bottom;
+
+            // If the grid cell is larger than the maxWidth/maxHeight
+            // of this GridItem, then position the GridItem
+            // according to horizontalAlign & vertical
+            // Also, if the GridItem has a percentHeight that's less than 100%,
+            // then shrink the height of the GridItem so that it consumes only
+            // a fraction of the space allocated to the row.
+            var diff:Number = w - child.maxWidth;
+            if (diff > 0)
+            {
+                x += diff * mx_internal::layoutObject.getHorizontalAlignValue();
+                w -= diff;
+            }
+            diff = h - child.maxHeight;
+            if (percentHeight && percentHeight < 100)
+                diff = Math.max(diff, h * (100 - percentHeight));
+            if (diff > 0)
+            {
+                y = diff * mx_internal::layoutObject.getVerticalAlignValue();
+                h -= diff;
+            }
+
+            w = Math.ceil(w);
+            h = Math.ceil(h);
+
+            child.move(x, y);
+            child.setActualSize(w, h);
+        }
+
+        invalidateSizeFlag = oldSizeFlag;
+        invalidateDisplayListFlag = oldDisplayListFlag;
+    }
+
+    /**
+     *  @private
+     */
+    private function calculateColumnWidths():void
+    {
+        var vm:EdgeMetrics = viewMetricsAndPadding;
+        var gap:Number = getStyle("horizontalGap");
+        var numChildren:int = columnWidths.length;
+        var spaceForChildren:Number =
+            unscaledWidth - vm.left -
+            vm.right - (numChildren - 1) * gap;
+        var spaceToDistribute:Number;
+        var columnInfo:GridColumnInfo;
+        var left:Number;
+        var i:int;
+
+        var totalPercentWidth:Number = 0;
+        var flexibleColumnWidths:Array = [];
+        spaceToDistribute = spaceForChildren;
+
+        // If the child is flexible, store information about it in the
+        // flexibleColumnWidths.  For non-flexible children, just set the
+        // columnWidths[i].width property immediately.
+        //
+        // Also calculate the sum of all percentWidths, and calculate the
+        // sum of the width of all non-flexible children.
+        for (i = 0; i < numChildren; i++)
+        {
+            columnInfo = columnWidths[i];
+            var percentWidth:Number = columnInfo.percent;
+
+            if (percentWidth)
+            {
+                totalPercentWidth += percentWidth;
+                flexibleColumnWidths.push(columnInfo);
+            }
+            else
+            {
+                var width:Number = columnInfo.width = columnInfo.preferred;
+                spaceToDistribute -= width;
+            }
+        }
+
+        // Distribute the extra space among the children.
+        if (totalPercentWidth)
+        {
+            spaceToDistribute = Flex.flexChildrenProportionally(
+                spaceForChildren, spaceToDistribute,
+                totalPercentWidth, flexibleColumnWidths);
+
+            // Copy the calculated width
+            // from columnInfo.space to columnInfo.width.
+            var numFlexChildren:int = flexibleColumnWidths.length;
+            for (i = 0; i < numFlexChildren; i++)
+            {
+                columnInfo = flexibleColumnWidths[i];
+                columnInfo.width = columnInfo.size;
+            }
+        }
+
+        // Set each child's x-coordinate.
+        left = vm.left + spaceToDistribute * mx_internal::layoutObject.getHorizontalAlignValue();
+        for (i = 0; i < numChildren; i++)
+        {
+            columnInfo = columnWidths[i];
+            columnInfo.x = left;
+            left += columnInfo.width + gap;
+        }
+    }
+}
+
+}


Moved Socket Security Error

Moved Socket Security Error

Moved Socket Security Error to closure.

--- src/com/axis/rtspclient/RTSPoverTCPHandle.as
+++ src/com/axis/rtspclient/RTSPoverTCPHandle.as
@@ -29,7 +29,9 @@
       channel.addEventListener(IOErrorEvent.IO_ERROR, function(event:IOErrorEvent):void {
         ErrorManager.dispatchError(732, [event.text]);
       });
-      channel.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
+      channel.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function(event:SecurityErrorEvent):void {
+        ErrorManager.dispatchError(731, [event.text]);
+      });
     }

     public function writeUTFBytes(value:String):void {
@@ -56,9 +58,5 @@
       /* should probably wait for close, but it doesn't seem to fire properly */
       dispatchEvent(new Event("closed"));
     }
-
-    private function onSecurityError(event:SecurityErrorEvent):void {
-      ErrorManager.dispatchError(731, [event.text]);
-    }
   }
 }


TODO -bpja: reverting xobj changeset 9632c87c5e09 - see comment in XObjXMLDecoder.as

--- as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
@@ -669,12 +669,22 @@
                                 }
                             }

-                            // use whatever class info we were given
-                            if (partObj)
-                            {
-                                partClass = XObjUtils.getClass(partObj);
-                                partClassName = XObjUtils.getClassName(partObj);
-                            }
+                            /*
+                            REMOVING until reviewed by bpja...
+                            causing xml decodes to "drop" some objects
+                            eg. AllPlatformsController (serverRetrievedPlatforms)
+                            2 platforms properly mapped to object, the rest were not...
+
+                            jb
+
+
+//                           */
+//                            // use whatever class info we were given
+//                            if (partObj)
+//                            {
+//                                partClass = XObjUtils.getClass(partObj);
+//                                partClassName = XObjUtils.getClassName(partObj);
+//                            }
                         }
                         else
                         {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableContainerBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableContainerBase.as
@@ -9,15 +9,15 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.components.baseClasses
+package spark.components.supportClasses
 {

 import flash.display.DisplayObject;
-import mx.components.baseClasses.FxComponent;
+import spark.components.supportClasses.SkinnableComponent;
 import mx.core.ContainerGlobals;
 import mx.core.IFlexDisplayObject;
 import mx.managers.IFocusManagerContainer;
-import mx.utils.MouseShieldUtil;
+import spark.utils.MouseShieldUtil;

 /**
@@ -48,7 +48,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxContainerBase extends FxComponent implements IFocusManagerContainer
+public class SkinnableContainerBase extends SkinnableComponent implements IFocusManagerContainer
 {
     include "../../core/Version.as";

@@ -66,7 +66,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxContainerBase()
+    public function SkinnableContainerBase()
     {
         super();
     }


FEC-4300 - better support for early phase seeking.

when performing seek at the beginning of the entry, player downloads
all segments instead of the seeked segments

--- HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
+++ HLSPlugin/src/com/kaltura/hls/HLSIndexHandler.as
@@ -39,7 +39,7 @@
 	{
 		// Polling interval when waiting on stuff like manifest reloads.
 		public static const SHORT_LIVE_STALL_DELAY:Number = 0.25;
-
+
 		// Time in seconds to wait before retrying a LIVE_STALL
 		public static const RETRY_INTERVAL:uint = 3;

@@ -47,34 +47,36 @@
 		public var bumpedTime:Boolean = false;
 		// The new current seek target.
 		public var bumpedSeek:Number = 0;
-
+
 		public var _lastSequence:int = 0;
 		public var _lastSequenceManifest:HLSManifestParser = null;
-
+
+		public var _pendingStartTime:Number = NaN;
+
 		public function updateLastSequence(newManifest:HLSManifestParser, newSeq:int):void
 		{
 			trace("UPDATING LAST SEQUENCE " + newSeq + " manifest=" + newManifest.fullUrl);
 			_lastSequence = newSeq;
 			_lastSequenceManifest = newManifest;
 		}
-
+
 		public function getLastSequence():int
 		{
 			return _lastSequence;
 		}
-
+
 		public function getLastSequenceManifest():HLSManifestParser
 		{
 			return _lastSequenceManifest;
 		}
-
+
 		public function getLastSequenceSegments():Vector.<HLSManifestSegment>
 		{
 			if(_lastSequenceManifest)
 				return _lastSequenceManifest.segments;
 			return new Vector.<HLSManifestSegment>();
 		}
-
+
 		public var lastKnownPlaylistStartTime:Number = 0.0;
 		public var lastQuality:int = 0;
 		public var targetQuality:int = 0;
@@ -111,12 +113,12 @@
 		private var _bestEffortLastGoodFragmentDownloadTime:Date = null;

 		private var _pendingBestEffortRequest:HTTPStreamRequest = null;
-
+
 		private var _pendingBestEffortStartTime:int = -1;
-
+
 		public static var _lastBestEffortFetchURI:String;
 		public static var _lastBestEffortFetchDuration:Number;
-
+
 		private function isBestEffortActive():Boolean
 		{
 			var dt:int = getTimer() - _pendingBestEffortStartTime;
@@ -128,27 +130,27 @@
 				return true;
 			return false;
 		}
-
+
 		// constants used by getNextRequestForBestEffortPlay:
 		private static const BEST_EFFORT_PLAY_SITUAUTION_NORMAL:String = "normal";
 		private static const BEST_EFFORT_PLAY_SITUAUTION_DROPOUT:String = "dropout";
 		private static const BEST_EFFORT_PLAY_SITUAUTION_LIVENESS:String = "liveness";
 		private static const BEST_EFFORT_PLAY_SITUAUTION_DONE:String = "done";
-
+
 		// We keep a list of witnesses of known PTS start values for segments.
 		// This is indexed by segment URL and returns the PTS start for that
 		// seg if known.  Since all segments are immutable, we can keep this
 		// as a global cache.
 		public static var startTimeWitnesses:Object = {};
 		public static var endTimeWitnesses:Object = {};
-
-
+
+
 		CONFIG::LOGGING
 		{
 			private static const logger:Logger = Log.getLogger("org.osmf.net.httpstreaming.HTTPNetStream");
 			private var previouslyLoggedState:String = null;
 		}
-
+
 		public function HLSIndexHandler(_resource:MediaResourceBase, _fileHandler:HTTPStreamingFileHandlerBase)
 		{
 			resource = _resource as HLSStreamingResource;
@@ -156,34 +158,34 @@
 			baseUrl = manifest.baseUrl;
 			fileHandler = _fileHandler as M2TSFileHandler;
 			fileHandler.extendedIndexHandler = this;
-
+
 			_bestEffortFileHandler.addEventListener(HTTPStreamingEvent.FRAGMENT_DURATION, onBestEffortParsed);
 			_bestEffortFileHandler.isBestEffort = true;
 		}
-
-
+
+
 		// Using our witnesses, fill in as much knowledge as we can about
 		// segment start/end times.
 		public function updateSegmentTimes(segments:Vector.<HLSManifestSegment>):Vector.<HLSManifestSegment>
 		{
 			// Keep track of whatever segments we've assigned to.
 			var setSegments:Object = {};
-
+
 			// First, set any exactly known values.
 			for(var i:int=0; i<segments.length; i++)
 			{
 				// Skip unknowns.
 				if(!startTimeWitnesses.hasOwnProperty(segments[i].uri))
 					continue;
-
+
 				segments[i].startTime = Math.max(0, startTimeWitnesses[segments[i].uri]);
-
+
 				if(endTimeWitnesses.hasOwnProperty(segments[i].uri))
 					segments[i].duration = endTimeWitnesses[segments[i].uri] - segments[i].startTime;

 				setSegments[i] = 1;
 			}
-
+
 			if(segments.length > 1)
 			{
 				// Then fill in any unknowns scanning forward....
@@ -192,35 +194,35 @@
 					// Skip unknowns.
 					if(!setSegments.hasOwnProperty(i-1) || setSegments.hasOwnProperty(i))
 						continue;
-
+
 					segments[i].startTime = Math.max(0, segments[i-1].startTime + segments[i-1].duration);
 					setSegments[i] = 1;
 				}
-
+
 				// And scanning back...
 				for(i=segments.length-2; i>=0; i--)
 				{
 					// Skip unknowns.
 					if(!setSegments.hasOwnProperty(i+1) || setSegments.hasOwnProperty(i))
 						continue;
-
+
 					segments[i].startTime = Math.max(0, segments[i+1].startTime - segments[i].duration);
 					setSegments[i] = 1;
 				}
 			}
-
+
 			// Dump results:
 			/*trace("Last 10 manifest time reconstruction");
 			for(i=Math.max(0, segments.length - 100); i<segments.length; i++)
 			{
-				trace("segment #" + i + " start=" + segments[i].startTime + " duration=" + segments[i].duration + "uri=" + segments[i].uri);
+			trace("segment #" + i + " start=" + segments[i].startTime + " duration=" + segments[i].duration + "uri=" + segments[i].uri);
 			}
 			trace("Reconstructed manifest time with knowledge=" + checkAnySegmentKnowledge(segments) + " firstTime=" + (segments.length > 1 ? segments[0].startTime : -1) + " lastTime=" + (segments.length > 1 ? segments[segments.length-1].startTime : -1));*/
-
+
 			// Done!
 			return segments;
 		}
-
+
 		/**
 		 * Return true if we have encountered any segments from this list of segments. Useful for
 		 * determining if we need to do a best effort based seek and/or if the estimates are any good.
@@ -234,10 +236,10 @@
 				if(startTimeWitnesses.hasOwnProperty(segments[i].uri))
 					return true;
 			}
-
+
 			return false;
 		}
-
+
 		public static function getSegmentBySequence(segments:Vector.<HLSManifestSegment>, id:int):HLSManifestSegment
 		{
 			// Find matches.
@@ -248,11 +250,11 @@
 					continue;
 				return seg;
 			}
-
+
 			return null;
 		}
-
-
+
+
 		public static function getSegmentBySequenceCapped(segments:Vector.<HLSManifestSegment>, id:int):HLSManifestSegment
 		{
 			if(segments.length >= 1)
@@ -265,7 +267,7 @@
 					return segments[segments.length - 1];
 				}
 			}
-
+
 			// Find matches via linear search.
 			for(var i:int=0; i<segments.length; i++)
 			{
@@ -274,10 +276,10 @@
 					continue;
 				return seg;
 			}
-
+
 			return null;
 		}
-
+
 		public static function getSegmentStartTimeBySequence(segments:Vector.<HLSManifestSegment>, id:int):Number
 		{
 			// Find matches.
@@ -287,10 +289,10 @@
 				if(seg.id == id)
 					return seg.startTime;
 			}
-
+
 			return -1;
 		}
-
+
 		/**
 		 * Find the segment from a time-ordered list containing the specified time.
 		 *
@@ -334,7 +336,7 @@
 						return segments[i];
 				}
 			}
-
+
 			// No match, dump to aid debug.
 			var seg:HLSManifestSegment;
 			if(segments.length <= 10)
@@ -353,9 +355,9 @@
 					seg = segments[i];
 					trace("#" + i + " id=" + seg.id + " start=" + seg.startTime + " end=" + (seg.startTime + seg.duration));
 				}
-
+
 				trace(" .... skipping middle ....");
-
+
 				// Last 3
 				for(i=segments.length-4; i<segments.length-1; i++)
 				{
@@ -363,10 +365,10 @@
 					trace("#" + i + " id=" + seg.id + " start=" + seg.startTime + " end=" + (seg.startTime + seg.duration));
 				}
 			}
-
+
 			return null;
 		}
-
+
 		/**
 		 * Get the index of the segment containing a certain time.
 		 */
@@ -377,7 +379,7 @@
 				return -1;
 			return seg.id;
 		}
-
+
 		public override function initialize(indexInfo:Object):void
 		{
 			postRatesReady();
@@ -421,10 +423,10 @@
 		{
 			if (reloadTimer)
 				reloadTimer.stop(); // In case the timer is active - don't want to do another reload in the middle of it
-
+
 			trace("Scheduling reload for quality " + quality);
 			reloadingQuality = quality;
-
+
 			// Reload the manifest we were given, if we were given a manifest
 			var manToReload:HLSManifestParser = manifest ? manifest : getManifestForQuality(reloadingQuality);
 			if(getTimer() - manToReload.timestamp < (manToReload.targetDuration * 500))
@@ -434,12 +436,12 @@
 				dispatchDVRStreamInfo();
 				updateTotalDuration();
 				reloadingManifest = null; // don't want to hang on to it
-
+
 				if (reloadTimer) reloadTimer.start();
-
+
 				stalled = false;
 				HLSHTTPNetStream.hasGottenManifest = true;
-
+
 				return;
 			}

@@ -560,7 +562,7 @@

 			return true;
 		}
-
+
 		/**
 		 * Attempt to remap a sequence from an old manifest to a new.
 		 *
@@ -577,21 +579,21 @@
 				trace("remapSequence - no currentManifest!")
 				return -1;
 			}
-
+
 			if(newManifest == null)
 			{
 				trace("remapSequence - no newManifest!");
 				return -1;
 			}
-
+
 			if(currentManifest.fullUrl == newManifest.fullUrl)
 			{
 				trace("Remapping from/to same URL, no op.");
 				return currentSequence;
 			}
-
+
 			var newSequence:int = -1;
-
+
 			// Check knowledge on both sequences and queue request as appropriate.
 			if(!checkAnySegmentKnowledge(newManifest.segments) && !isBestEffortActive())
 			{
@@ -603,7 +605,7 @@
 				trace("(B) Encountered a live/VOD manifest with no timebase knowledge, request newest segment via best effort path for quality " + reloadingQuality);
 				_pendingBestEffortRequest = initiateBestEffortRequest(getLastSequence() + 1, lastQuality, currentManifest.segments, currentManifest);
 			}
-
+
 			if(!checkAnySegmentKnowledge(newManifest.segments) || !checkAnySegmentKnowledge(currentManifest.segments))
 			{
 				trace("Bailing on remap due to lack of knowledge!");
@@ -611,18 +613,18 @@
 				// re-reload.
 				reloadingManifest = null; // don't want to hang on to this one.
 				if (reloadTimer) reloadTimer.start();
-
+
 				return -1;
 			}
-
+
 			// Remap time!
 			updateSegmentTimes(currentManifest.segments);
 			updateSegmentTimes(newManifest.segments);
-
+
 			const fudgeTime:Number = 0.2; //1.0 / 24; // Approximate acceptable jump.
 			var currentSeg:HLSManifestSegment = getSegmentBySequence(currentManifest.segments, currentSequence);
 			var newSeg:HLSManifestSegment = currentSeg ? getSegmentContainingTime(newManifest.segments, currentSeg.startTime + (end ? currentSeg.duration + fudgeTime : 0) , end) : null;
-
+
 			// When in live stream, try to keep things in bound.
 			if(newSeg == null)
 			{
@@ -633,12 +635,12 @@
 				}

 				trace("Remapping from " + currentSequence);
-
+
 				if(currentSeg)
 				{
 					// Guess by time....
 					trace("Found last seg with startTime = " + currentSeg.startTime + " duration=" + currentSeg.duration);
-
+
 					// If the segment is beyond last ID, then jump to end...
 					if(currentSeg.startTime + currentSeg.duration >= newManifest.segments[newManifest.segments.length-1].startTime)
 					{
@@ -655,7 +657,7 @@
 				{
 					// Guess by sequence number...
 					trace("No last seg found");
-
+
 					// If the segment is beyond last ID, then jump to end...
 					if(currentSequence >= newManifest.segments[newManifest.segments.length-1].id)
 					{
@@ -675,12 +677,12 @@
 				newSequence = newSeg.id;
 				trace("===== Remapping to #" + newSequence + " start=" + newSeg.startTime + " end=" + (newSeg.startTime + newSeg.duration) );
 			}
-
+
 			// And note how we ended.
 			trace("   o Ended at " + newSequence);
 			return newSequence;
 		}
-
+
 		private function onReloadComplete(event:Event):void
 		{
 			if(event.target != reloadingManifest)
@@ -688,22 +690,22 @@
 				trace("Rejecting invalid onReloadComplete call.");
 				return;
 			}
-
+
 			trace ("::onReloadComplete - last/reload/target: " + lastQuality + "/" + reloadingQuality + "/" + targetQuality);
 			var newManifest:HLSManifestParser = event.target as HLSManifestParser;
 			trace ("     - url=" + newManifest.fullUrl);
-
+
 			if(!newManifest)
 			{
 				trace("::onReloadComplete - failed to get new manifest?!");
-
+
 				// Same as at end of function.
 				dispatchDVRStreamInfo();
 				reloadingManifest = null; // don't want to hang on to it
 				if (reloadTimer) reloadTimer.start();
 				return;
 			}
-
+
 			// Detect if there are 0 segments in the new manifest
 			if (newManifest.segments.length == 0)
 			{
@@ -742,22 +744,22 @@
 					}
 				}
 			}
-
+
 			var currentManifest:HLSManifestParser = getManifestForQuality(lastQuality);

 			var timerOnErrorDelay:Number = newManifest.targetDuration * 1000  / 2;

-
+
 			// Remap if needed.
 			var newSequence:int = remapSequence(getLastSequenceManifest(), newManifest, getLastSequence(), false);
-
+
 			// Store the new manifest.
 			trace("Updating manifest for quality " + reloadingQuality);
 			if(manifest.streams.length)
 				manifest.streams[reloadingQuality].manifest = newManifest;
 			else
 				manifest = newManifest;
-
+
 			// If it's a change and remap fails, we can abort.
 			if(newSequence == -1 && (!getLastSequenceManifest() || newManifest.fullUrl != getLastSequenceManifest().fullUrl))
 			{
@@ -766,35 +768,35 @@
 				trace("Can't remap to new manifest, aborting!")
 				return;
 			}
-
+
 			// Update our manifest for this quality level.
 			//trace("Changing from " + lastQuality + " to " + reloadingQuality);
 			lastQuality = reloadingQuality;
-
+
 			// Update last sequence state.
 			updateLastSequence(newManifest, newSequence);
-
+
 			// Kick off the next round as appropriate.
 			dispatchDVRStreamInfo();
 			updateTotalDuration();
 			reloadingManifest = null; // don't want to hang on to it
 			if (reloadTimer) reloadTimer.start();
-
+
 			stalled = false;
 			HLSHTTPNetStream.hasGottenManifest = true;
-
+
 			// Debug to JS.
 			manifest.postToJS();
 		}
-
+
 		public function getQualityLevelStreamName(index:int):String
 		{
 			if(!resource)
 				return null;
-
+
 			if(index < 0 || index > resource.streamItems.length)
 				return null;
-
+
 			return resource.streamItems[index].streamName;
 		}

@@ -802,7 +804,7 @@
 		{
 			var streams:Array = [];
 			var rates:Array = [];
-
+
 			// Make a copy of the streamItems and sort them by bitrate ascending.
 			for(var i:int=0; i<resource.streamItems.length; i++)
 			{
@@ -850,7 +852,7 @@
 			reload(targetQuality);
 			return lastQuality;
 		}
-
+
 		public function get liveEdge():Number
 		{
 			trace("Getting live edge using targetQuality=" + targetQuality);
@@ -865,14 +867,26 @@
 		public override function getFileForTime(time:Number, quality:int):HTTPStreamRequest
 		{
 			trace("--- getFileForTime(time=" + time + ", quality=" + quality + ")");
-
+
 			targetQuality = quality;
-
+
 			// Force a reload if needed.
 			var manifestResponse:HTTPStreamRequest = issueManifestReloadIfNeeded(quality);
-			if(manifestResponse != null)
+			if(manifestResponse != null){
+				_pendingStartTime = time;
 				return manifestResponse;
-
+			}
+
+			// Fire any pending best effort.
+			if(_pendingBestEffortRequest)
+			{
+				trace("getFileForTime - Firing pending best effort request: " + _pendingBestEffortRequest);
+				var tmpR:HTTPStreamRequest = _pendingBestEffortRequest;
+				_pendingBestEffortRequest = null;
+				_pendingStartTime = time;
+				return tmpR;
+			}
+
 			var origQuality:int = quality;
 			quality = getWorkingQuality(quality);
 			var segments:Vector.<HLSManifestSegment> = getSegmentsForQuality( origQuality );
@@ -881,6 +895,8 @@
 			{
 				if(!isBestEffortActive())
 				{
+					_pendingStartTime = time;
+
 					// We may also need to establish a timebase.
 					trace("getFileForTime - Seeking without timebase; initiating request.");
 					if(getLastSequenceManifest())
@@ -919,29 +935,32 @@
 					return new HTTPStreamRequest (HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 				}
 			}
-
+
+			// If we get here pending start time isn't needed any longer.
+			_pendingStartTime = NaN;
+
 			// Debug to JS.
 			manifest.postToJS();
-
+
 			if(time < segments[0].startTime)
 			{
 				trace("getFileForTime - SequenceSkip - time: " + time + " playlistStartTime: " + segments[0].startTime);
 				time = segments[0].startTime;   /// TODO: HACK Alert!!! < this should likely be handled by DVRInfo (see dash plugin index handler)
-												/// No longer quite so sure this is a hack, but a requirement
+				/// No longer quite so sure this is a hack, but a requirement
 				++sequenceSkips;
-
+
 				//bumpedTime = true;
 				//bumpedSeek = time;
 			}
-
+
 			var seq:int = getSegmentSequenceContainingTime(segments, time);
-
+
 			if(seq == -1 && segments.length >= 2)
 			{
 				trace("getFileForTime - Got out of bound timestamp. Trying to recover...");
-
+
 				var lastSeg:HLSManifestSegment = segments[Math.max(0, segments.length - (HLSManifestParser.MAX_SEG_BUFFER+1))];
-
+
 				if(time < segments[0].startTime)
 				{
 					trace("getFileForTime - Fell off oldest segment, going to start #" + segments[0].id)
@@ -955,18 +974,18 @@
 					//bumpedTime = true;
 				}
 			}
-
+
 			if(seq != -1)
 			{
 				var curSegment:HLSManifestSegment = getSegmentBySequence(segments, seq);
-
+
 				// If we need to, stall on the decrypt key.
 				var theKey:HLSManifestEncryptionKey = getKeyForSequence( curSegment.id, manifest );
 				if(theKey)
 				{
 					if(theKey.isLoading == false && theKey.isLoaded == false)
 						theKey.load();
-
+
 					if(theKey.isLoaded == false)
 					{
 						// Stall on key.
@@ -974,9 +993,9 @@
 						return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 					}
 				}
-
+
 				updateLastSequence(getManifestForQuality(origQuality), seq);
-
+
 				fileHandler.segmentId = seq;
 				fileHandler.key = theKey;
 				fileHandler.segmentUri = curSegment.uri;
@@ -1009,19 +1028,19 @@
 			}
 			return null;
 		}
-
+
 		private function issueManifestReloadIfNeeded(quality:int):HTTPStreamRequest
 		{
 			// If we don't need a reload, return null.
 			var manToReload:HLSManifestParser = getManifestForQuality(quality);
-
+
 			// If it's VOD, never need this.
 			if(manToReload.streamEnds)
 			{
 				trace("issueManifestReloadIfNeeded - VODs do not need to reload, returning.");
 				return null;
 			}
-
+
 			var curTime:uint = getTimer();
 			if(curTime - manToReload.timestamp < manToReload.targetDuration * 500)
 			{
@@ -1029,7 +1048,7 @@
 				trace("issueManifestReloadIfNeeded - Don't need to reload yet.");
 				return null;
 			}
-
+
 			if(reloadingManifest
 				&& reloadingManifest.quality == quality
 				&& curTime - reloadingManifest.lastReloadRequestTime < manToReload.targetDuration * 500
@@ -1039,31 +1058,38 @@
 				trace("issueManifestReloadIfNeeded - waiting on reload");
 				return new HTTPStreamRequest (HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 			}
-
+
 			// Otherwise, issue a reload and return a stall.
 			if (reloadTimer)
 				reloadTimer.stop(); // In case the timer is active - don't want to do another reload in the middle of it
-
+
 			trace("issueManifestReloadIfNeeded - Firing reload for quality " + quality);

 			reloadingQuality = quality;
-
+
 			reloadingManifest = new HLSManifestParser();
 			reloadingManifest.quality = quality;
 			reloadingManifest.type = manToReload.type;
 			reloadingManifest.addEventListener(Event.COMPLETE, onReloadComplete);
 			reloadingManifest.addEventListener(IOErrorEvent.IO_ERROR, onReloadError);
 			reloadingManifest.reload(manToReload);
-
+
 			return new HTTPStreamRequest (HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 		}

 		public override function getNextFile(quality:int):HTTPStreamRequest
 		{
 			trace("--- getNextFile(" + quality + ")");
-
+
 			targetQuality = quality;
-
+
+			// Switch to getFileForTime if a pending time is present.
+			if(!isNaN(_pendingStartTime))
+			{
+				trace("getNextFile - pending start time, going to getFileForTime");
+				return getFileForTime(_pendingStartTime, quality);
+			}
+
 			// Fire any pending best effort requests.
 			if(_pendingBestEffortRequest)
 			{
@@ -1072,32 +1098,32 @@
 				_pendingBestEffortRequest = null;
 				return pber;
 			}
-
+
 			var manifestResponse:HTTPStreamRequest = issueManifestReloadIfNeeded(quality);
 			if(manifestResponse != null)
 			{
 				trace("Got a manifest response");
 				return manifestResponse;
 			}
-
+
 			// Report stalls and/or wait on timebase establishment.
 			if (stalled)
 			{
 				trace("Stalling -- quality[" + quality + "] lastQuality[" + lastQuality + "]");
-
+
 				// TODO - ensure a reload is pending?
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 			}
-
+
 			HLSHTTPNetStream.recoveryStateNum = URLErrorRecoveryStates.NEXT_SEG_ATTEMPTED;

 			//trace("Pre GWQ " + quality);
 			var origQuality:int = quality;
 			quality = getWorkingQuality(quality);
-
+
 			var currentManifest:HLSManifestParser = getManifestForQuality ( origQuality );
 			var oldManifest:HLSManifestParser = getLastSequenceManifest();
-
+
 			// If this would be the final file on the original quality level, end.
 			if(currentManifest.streamEnds
 				&& currentManifest.segments.length > 0
@@ -1110,20 +1136,20 @@

 				return new HTTPStreamRequest(HTTPStreamRequestKind.DONE);
 			}
-
+
 			if(quality != origQuality && isBestEffortActive())
 			{
 				trace("Waiting on best effort to resolve...");
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 			}
-
+
 			// If no old manifest, it's a new play session.
 			var didWeSeedLastSequence:Boolean = false;
 			if(oldManifest == null)
 			{
 				trace("SEEDING LAST SEQUENCE");
 				didWeSeedLastSequence = true;
-
+
 				if(currentManifest.streamEnds == true)
 				{
 					updateLastSequence(currentManifest, 0);
@@ -1135,24 +1161,24 @@
 							currentManifest.segments.length - HLSManifestParser.MAX_SEG_BUFFER - 1)].id);
 				}
 			}
-
+
 			// Fire a reload if needed.
 			if(quality != origQuality && manifest.streamEnds == false)
 			{
 				trace("Firing reload of manifest for quality " + origQuality);
-
+
 				var hadPendingReload:Boolean = reloadingManifest != null;
-
+
 				// Kick the reloader.
 				onReloadTimer(null);
 			}
-
+
 			// Attempt remap.
 			var newSequence:int = remapSequence(getLastSequenceManifest(), currentManifest, getLastSequence());

 			// Debug to JS.
 			manifest.postToJS();
-
+
 			if(newSequence == -1)
 			{
 				if(_pendingBestEffortRequest && !isBestEffortActive())
@@ -1168,38 +1194,38 @@
 					return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 				}
 			}
-
+
 			// Stall if we aren't ready to go.
 			if(quality != origQuality && manifest.streamEnds == false)
 			{
 				trace("Stalling for manifest -- quality[" + quality + "] lastQuality[" + lastQuality + "]");
-
+
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, 2);
 			}
-
+
 			// Advance sequence number if we didn't seed. This prevents us from
 			// inadvertantly advancing past the first segment of a video in streams
 			// with non-zero start times. We also don't increment when moving across
 			// quality levels as the remap and low water systems handles any overlap.
 			if(!didWeSeedLastSequence && (currentManifest.fullUrl == getLastSequenceManifest().fullUrl))
 				newSequence++;
-
+
 			var segments:Vector.<HLSManifestSegment> = currentManifest.segments;
-
+
 			if( segments.length > 0 && newSequence < segments[0].id)
 			{
 				trace("Resetting too low sequence " + newSequence + " to " + segments[0].id);
 				newSequence = segments[0].id;
 			}
-
+
 			if (segments.length > 0 && newSequence > (segments[Math.max(0, segments.length-1)].id + 3))
 			{
 				trace("Got in a bad state of " + newSequence + " , resetting to near end of stream " + segments[segments.length-HLSManifestParser.MAX_SEG_BUFFER].id);
 				newSequence = segments[segments.length-HLSManifestParser.MAX_SEG_BUFFER].id;
 			}
-
+
 			var curSegment:HLSManifestSegment = getSegmentBySequence(segments, newSequence);
-
+
 			if ( curSegment != null )
 			{
 				// If we need to, stall on the decrypt key.
@@ -1208,7 +1234,7 @@
 				{
 					if(theKey.isLoading == false && theKey.isLoaded == false)
 						theKey.load();
-
+
 					if(theKey.isLoaded == false)
 					{
 						// Stall on key.
@@ -1216,25 +1242,25 @@
 						return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 					}
 				}
-
+
 				trace("Getting Next Segment[" + newSequence + "] StartTime: " + curSegment.startTime + " Continuity: " + curSegment.continuityEra + " URI: " + curSegment.uri);

 				// Note new value.
 				updateLastSequence(currentManifest, newSequence);
-
+
 				//bumpedSeek = curSegment.startTime;
-
+
 				fileHandler.segmentId = newSequence;
 				fileHandler.key = theKey;
 				fileHandler.segmentUri = curSegment.uri;
-
+
 				return createHTTPStreamRequest( curSegment );
 			}

 			if ( reloadingManifest || !manifest.streamEnds )
 			{
 				trace("Stalling -- requested segment " + newSequence + " past the end " + segments[segments.length-1].id + " and we're in a live stream");
-
+
 				return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, segments[segments.length-1].duration / 2);
 			}

@@ -1253,7 +1279,7 @@

 			if(localManifest)
 				keys = localManifest.keys;
-
+
 			// What is the index of this id?
 			var foundIdx:int = -1;
 			for(var i:int=0; i<localManifest.segments.length; i++)
@@ -1261,10 +1287,10 @@
 				if(localManifest.segments[i].id == segId)
 					foundIdx = i;
 			}
-
+
 			if(foundIdx == -1)
 				return null;
-
+
 			for (i = 0; i < keys.length; i++ )
 			{
 				var key:HLSManifestEncryptionKey = keys[ i ];
@@ -1297,11 +1323,11 @@

 			if(!manifest)
 				return;
-
+
 			// Fetch active data.
 			var activeManifest:HLSManifestParser = getManifestForQuality(lastQuality);
 			var segments:Vector.<HLSManifestSegment> = activeManifest.segments;
-
+
 			if(segments.length > 0)
 			{
 				lastKnownPlaylistStartTime = segments[0].startTime;
@@ -1311,7 +1337,7 @@
 					accum = (segments[i].startTime + segments[i].duration) - lastKnownPlaylistStartTime;
 				}
 			}
-
+
 			// Push the metadata out.
 			var metadata:Object = new Object();
 			metadata.duration = accum;
@@ -1319,7 +1345,7 @@
 			tag.objects = ["onMetaData", metadata];
 			dispatchEvent(new HTTPStreamingEvent(HTTPStreamingEvent.SCRIPT_DATA, false, false, 0, tag, FLVTagScriptDataMode.IMMEDIATE));
 		}
-
+
 		// getSegmentIndexForTime()
 		//		returns
 		//			-1 if there is no manifest or no valid segments
@@ -1335,7 +1361,7 @@
 				return -1;

 			var segments:Vector.<HLSManifestSegment> = getSegmentsForQuality( lastQuality );
-
+
 			for (var i:int = segments.length - 1; i >= 0; --i)
 			{
 				if (segments[i].startTime < time)
@@ -1368,12 +1394,12 @@
 				trace("Failed to dispatch DVR info, no segments!");
 				return;
 			}
-
+
 			updateSegmentTimes(segments);
-
+
 			var firstSegment:HLSManifestSegment = segments[0];
 			var lastSegment:HLSManifestSegment  = segments[segments.length - 1];
-
+
 			var dvrInfo:DVRInfo = new DVRInfo();
 			dvrInfo.offline = false;
 			dvrInfo.isRecording = !curManifest.streamEnds;  // TODO: verify that this is what we REALLY want to be doing
@@ -1417,13 +1443,13 @@
 			if (!manifest) return new HLSManifestParser();
 			if (manifest.streams.length < 1 || manifest.streams[0].manifest == null) return manifest;
 			else if ( quality >= manifest.streams.length ) return manifest.streams[0].manifest;
-
+
 			// We give the HLSHTTPNetStream the stream for the quality we are currently using to help it recover after a URL error
 			HLSHTTPNetStream.currentStream = manifest.streams[quality];
-
+
 			// Also give HLSHTTPNetStream a reference to ourselves so it can call postRatesReady()
 			HLSHTTPNetStream.indexHandler = this;
-
+
 			return manifest.streams[quality].manifest;
 		}

@@ -1457,7 +1483,7 @@
 				trace("lastSegmentIndex: " + getLastSequence() + " | max allowed index: " + segments[segments.length - 1].id);
 				trace("Setting lastSegmentIndex to " + segments[segments.length - 1].id);
 				getLastSequence() = segments[segments.length - 1].id;
-
+
 				// Back off by one as it will get incremented later.
 				//lastSequence--; */
 			}
@@ -1490,12 +1516,12 @@
 			var segment:HLSManifestSegment = getSegmentBySequence( segments, getLastSequence() );
 			return segment ? segment.startTime + segment.duration : 0.0;
 		}
-
+
 		public function getTargetSegmentDuration():Number
 		{
 			return getManifestForQuality(lastQuality).targetDuration;
 		}
-
+
 		/**
 		 * @private
 		 *
@@ -1520,23 +1546,23 @@
 				trace("initiateBestEffortRequest - No manifest found to best effort request quality level " + quality);
 				return null;
 			}
-
+
 			if(!segments)
 			{
 				segments = newMan.segments;
 			}
-
+
 			if(!segments)
 			{
 				trace("initiateBestEffortRequest - NO SEGMENTS FOUND, ABORTING initiateBestEffortRequest");
 				return null;
 			}
-
+
 			var nextSeg:HLSManifestSegment = getSegmentBySequenceCapped(segments, nextFragmentId);
 			if(nextSeg.id != nextFragmentId)
 			{
 				trace("Out of bounds best effort segment ID request, using " + nextSeg.id + " instead of " + nextFragmentId);
-
+
 				// Wait for manifest to reload, we probably hit live edge!
 				if(nextSeg.id < nextFragmentId)
 				{
@@ -1552,14 +1578,14 @@
 					}
 				}
 			}
-
+
 			// If we need to, stall on the decrypt key.
 			var theKey:HLSManifestEncryptionKey = getKeyForSequence( nextSeg.id, newMan );
 			if(theKey)
 			{
 				if(theKey.isLoading == false && theKey.isLoaded == false)
 					theKey.load();
-
+
 				if(theKey.isLoaded == false)
 				{
 					// Stall on key.
@@ -1567,18 +1593,18 @@
 					return new HTTPStreamRequest(HTTPStreamRequestKind.LIVE_STALL, null, SHORT_LIVE_STALL_DELAY);
 				}
 			}
-
+
 			// recreate the best effort download monitor
 			// this protects us against overlapping best effort downloads
 			_bestEffortDownloaderMonitor = new EventDispatcher();
 			_bestEffortDownloaderMonitor.addEventListener(HTTPStreamingEvent.DOWNLOAD_COMPLETE, onBestEffortDownloadComplete);
 			_bestEffortDownloaderMonitor.addEventListener(HTTPStreamingEvent.DOWNLOAD_ERROR, onBestEffortDownloadError);
-
-
+
+
 			_bestEffortFileHandler.segmentId = nextSeg.id;
 			_bestEffortFileHandler.key = theKey;
 			_bestEffortFileHandler.segmentUri = nextSeg.uri;
-
+
 			var streamRequest:HTTPStreamRequest =  new HTTPStreamRequest(
 				HTTPStreamRequestKind.BEST_EFFORT_DOWNLOAD,
 				_bestEffortFileHandler.segmentUri, // url
@@ -1586,9 +1612,9 @@
 				_bestEffortDownloaderMonitor); // bestEffortDownloaderMonitor

 			_pendingBestEffortStartTime = getTimer();
-
+
 			trace("initiateBestEffortRequest - Requesting: " + streamRequest.toString());
-
+
 			return streamRequest;
 		}

@@ -1622,7 +1648,7 @@
 				trace("bufferAndParseDownloadedBestEffortBytes - Already set our reply to " + _bestEffortDownloadReply + ", so ignoring data...");
 				return;
 			}
-
+
 			try
 			{
 				var downloaderAvailableBytes:uint = downloader.totalAvailableBytes;
@@ -1642,13 +1668,13 @@

 					// Reset parsing process.
 					_bestEffortFileHandler.beginProcessFile(false, 0.0);
-
+
 					// feed the bytes to our f4f handler in order to parse out the bootstrap box.
 					trace("processing segment");
 					_bestEffortFileHandler.processFileSegment(_bestEffortSeekBuffer);
-
+
 					_bestEffortFileHandler.endProcessFile(_bestEffortSeekBuffer);
-
+
 					if(_bestEffortDownloadReply == HTTPStreamingEvent.DOWNLOAD_CONTINUE)
 					{
 						// we're done parsing and the HTTPStreamSource is going to process the file,
@@ -1674,15 +1700,15 @@
 				trace("Failed to parse best effort segment due to " + e.toString() + "\n " + e.getStackTrace());
 			}
 		}
-
+
 		protected function onBestEffortParsed(e:Event):void
 		{
 			// Currently a nop.
 			trace("Got duration from best effort segment: " + _bestEffortFileHandler.segmentUri);
-
+
 			// Try again.
 			stalled = false;
-
+
 			// Update DVR info in case we gained knowledge.
 			dispatchDVRStreamInfo();
 		}
@@ -1701,7 +1727,7 @@
 				trace("Got event for abandoned best effort download!");
 				return;
 			}
-
+
 			trace("Best effort download complete " + event.toString());

 			// unregister the listeners
@@ -1710,7 +1736,7 @@
 			trace("Start download parse");
 			bufferAndParseDownloadedBestEffortBytes(event.url, event.downloader as HLSHTTPStreamDownloader);
 			trace("end download parse");
-
+
 			// forward the DOWNLOAD_COMPLETE to HTTPStreamSource, but change the reason
 			var clone:HTTPStreamingEvent = new HTTPStreamingEvent(
 				event.type,
@@ -1724,35 +1750,35 @@
 				HTTPStreamingEventReason.BEST_EFFORT,
 				event.downloader);
 			dispatchEvent(clone);
-
+
 			// Note our download time so we can force the right duration
 			// rather than getting confused by speedy cache responses.
 			_lastBestEffortFetchURI = _bestEffortFileHandler.segmentUri;
 			_lastBestEffortFetchDuration = getTimer() - _pendingBestEffortStartTime;
-
+
 			// Is it the next one we want?
 			// This code path seems to result in buffer time getting screwed up and doesn't solve the
 			// bandwidth calculation/bitrate selection issues.
 			/*if(getLastSequenceManifest() && getManifestForQuality(targetQuality))
 			{
-				var nextSeg:HLSManifestSegment = getSegmentBySequence(getManifestForQuality(targetQuality).segments, getLastSequence() + 1);
-				if(nextSeg)
-				{
-					var nextUri:String = nextSeg.uri;
-					trace("onBestEffortDownloadComplete - Checking " + _bestEffortFileHandler.segmentUri + " vs " + nextUri);
-					if(_bestEffortFileHandler.segmentUri == nextUri)
-					{
-						trace("Keeping this download buddy.");
-						continueBestEffortFetch(nextUri, event.downloader);
-
-						// And update the last sequence state.
-						updateLastSequence(getManifestForQuality(targetQuality), getLastSequence() + 1);
-
-						return;
-					}
-				}
+			var nextSeg:HLSManifestSegment = getSegmentBySequence(getManifestForQuality(targetQuality).segments, getLastSequence() + 1);
+			if(nextSeg)
+			{
+			var nextUri:String = nextSeg.uri;
+			trace("onBestEffortDownloadComplete - Checking " + _bestEffortFileHandler.segmentUri + " vs " + nextUri);
+			if(_bestEffortFileHandler.segmentUri == nextUri)
+			{
+			trace("Keeping this download buddy.");
+			continueBestEffortFetch(nextUri, event.downloader);
+
+			// And update the last sequence state.
+			updateLastSequence(getManifestForQuality(targetQuality), getLastSequence() + 1);
+
+			return;
+			}
+			}
 			}*/
-
+
 			// Otherwise skip.
 			skipBestEffortFetch(_bestEffortFileHandler.segmentUri, event.downloader as HLSHTTPStreamDownloader);
 		}
@@ -1770,9 +1796,9 @@
 				// we're receiving an event for a download we abandoned
 				return;
 			}
-
+
 			trace("Best effort download error " + event.toString());
-
+
 			// unregister our listeners
 			stopListeningToBestEffortDownload();

@@ -1813,7 +1839,7 @@
 				bestEffortLog("Best effort wanted to skip fragment, but we already replied with "+_bestEffortDownloadReply);
 				return;
 			}
-
+
 			bestEffortLog("Best effort skipping fragment.");
 			var event:HTTPStreamingEvent = new HTTPStreamingEvent(HTTPStreamingEvent.DOWNLOAD_SKIP,
 				false, // bubbles


Refactor Path

Refactor Path

--- src/main/org/shypl/common/util/SimplePath.as
+++ src/main/org/shypl/common/util/SimplePath.as
@@ -40,9 +40,14 @@
 		public function resolve(path:String):Path {
 			var i:int;
 			var p:Path = this;
-			while ((i = path.indexOf("../")) >= 0) {
+			while ((i = path.indexOf("..")) == 0) {
 				p = p.parent;
-				path = path.substr(3);
+				if (path.indexOf("../") == 0) {
+					path = path.substr(3);
+				}
+				else {
+					path = path.substr(2);
+				}
 			}
 			return factoryPath(p.empty ? path : (p.value + "/" + path));
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 20844
Author:   jimurphy@adobe.com
Date:     2011-03-14T15:10:07.899037Z

Log Message:
-----------
block hero_private revs 20698,20699,20702 from being merged into trunk
revert 20839,20841,20842,20843

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSCondition.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ISortField.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientBase.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/ColorDodgeShader.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarDataCanvas.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/OnDemandEventDispatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/PlotSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TabBar.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/StringUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/globalization/StringTools.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/CompoundTransform.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/AdvancedStyleClient.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/binding/utils/ChangeWatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>

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

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionViewCursor.as
@@ -304,9 +304,6 @@
     /**
      *  @inheritDoc
      *
-     *
Note that for this class, the view does not need to be sorted in order to
-     *  call this method.

-     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -343,9 +340,6 @@
     /**
      *  @inheritDoc
      *
-     *
Note that for this class, the view does not need to be sorted in order to
-     *  call this method.

-     *
      *  @langversion 3.0
      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
@@ -358,9 +352,6 @@

     /**
      *  @inheritDoc
-     *
-     *
Note that for this class, the view does not need to be sorted in order to
-     *  call this method.

      *
      *  @langversion 3.0
      *  @playerversion Flash 9
@@ -430,8 +421,8 @@
                     try
                     {
                         currentNode = childCursor.current;
-                        // update parent map
-                        updateParentMap(currentNode);
+						// update parent map
+						updateParentMap(currentNode);
                     }
                     catch (e:ItemPendingError)
                     {
@@ -589,8 +580,8 @@
                 }
             }
         }
-
-        updateParentMap(currentNode);
+
+		updateParentMap(currentNode);

         currentIndex++;
         return true;
@@ -748,7 +739,7 @@
             }
         }

-        updateParentMap(currentNode);
+		updateParentMap(currentNode);

         currentIndex--;
         return true;
@@ -908,20 +899,20 @@
         }
         return true;
     }
-
-    /**
-     * @private
-     * Update the parent map.
-     */
-    private function updateParentMap(currentNode:Object):void
-    {
-        if (currentNode != null)
-        {
-            var uid:String = UIDUtil.getUID(currentNode);
-            if (!collection.parentMap.hasOwnProperty(uid))
-                collection.parentMap[uid] = parentNodes[parentNodes.length - 1];
-        }
-    }
+
+	/**
+	 * @private
+	 * Update the parent map.
+	 */
+	private function updateParentMap(currentNode:Object):void
+	{
+		if (currentNode != null)
+		{
+			var uid:String = UIDUtil.getUID(currentNode);
+			if (!collection.parentMap.hasOwnProperty(uid))
+				collection.parentMap[uid] = parentNodes[parentNodes.length - 1];
+		}
+	}

     /**
      *  @private
@@ -1307,14 +1298,14 @@
             // dispatch CURSOR_UPDATE event
             collection.dispatchEvent(new FlexEvent(FlexEvent.CURSOR_UPDATE));
         }
-        else if (event.kind == CollectionEventKind.REFRESH)
-        {
-            // find the correct index of the item
-            if (!(beforeFirst || afterLast))
-            {
-                findFirst(current);
-            }
-        }
+		else if (event.kind == CollectionEventKind.REFRESH)
+		{
+			// find the correct index of the item
+			if (!(beforeFirst || afterLast))
+			{
+				findFirst(current);
+			}
+		}
     }
 }


Fix group chats

Fix group chats

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

--- src/org/jivesoftware/xiff/conference/Room.as
+++ src/org/jivesoftware/xiff/conference/Room.as
@@ -590,38 +590,38 @@
 					break;

 				case "presence":
-					var presence:Presence = eventObj.data;
-
 	                //trace("ROOM presence: " + presence.from + " : " + nickname);
-
-					if (presence.type == Presence.ERROR_TYPE) {
-						switch (presence.errorCode) {
-							case 409:
-								e = new RoomEvent(RoomEvent.NICK_CONFLICT);
-								e.nickname = nickname;
+					for each(var presence:Presence in eventObj.data)
+					{
+						if (presence.type == Presence.ERROR_TYPE) {
+							switch (presence.errorCode) {
+								case 409:
+									e = new RoomEvent(RoomEvent.NICK_CONFLICT);
+									e.nickname = nickname;
+									dispatchEvent(e);
+									break;
+							}
+						}
+						else if( isThisRoom( presence.from ) ) {
+							// If the presence has our pending nickname, nickname change went through
+							if( presence.from.split( "/" )[1] == pendingNickname ) {
+								myNickname = pendingNickname;
+								pendingNickname = null;
+							}
+
+							var user:MUCUserExtension = presence.getAllExtensionsByNS(MUCUserExtension.NS)[0];
+							if( user.statusCode == 201 ) {
+								unlockRoom(myIsReserved);
+			                }
+
+							updateRoomRoster( presence );
+
+							if (presence.type == Presence.UNAVAILABLE_TYPE && isActive() && isThisUser(presence.from)) {
+								//trace("Room: becoming inactive: " + presence.getNode());
+								active = false;
+								e = new RoomEvent(RoomEvent.ROOM_LEAVE);
 								dispatchEvent(e);
-								break;
-						}
-					}
-					else if( isThisRoom( presence.from ) ) {
-						// If the presence has our pending nickname, nickname change went through
-						if( presence.from.split( "/" )[1] == pendingNickname ) {
-							myNickname = pendingNickname;
-							pendingNickname = null;
-						}
-
-						var user:MUCUserExtension = presence.getAllExtensionsByNS(MUCUserExtension.NS)[0];
-						if( user.statusCode == 201 ) {
-							unlockRoom(myIsReserved);
-		                }
-
-						updateRoomRoster( presence );
-
-						if (presence.type == Presence.UNAVAILABLE_TYPE && isActive() && isThisUser(presence.from)) {
-							//trace("Room: becoming inactive: " + presence.getNode());
-							active = false;
-							e = new RoomEvent(RoomEvent.ROOM_LEAVE);
-							dispatchEvent(e);
+							}
 						}
 					}
 					break;


updated Plane.testRay() to use the Ray class + minor coding style fixes

--- src/aerys/minko/type/math/Plane.as
+++ src/aerys/minko/type/math/Plane.as
@@ -58,10 +58,22 @@
 		minko_math var _d		: Number	= 0.;
 		minko_math var _normal	: Vector4	= new Vector4();

-		public function get a() : Number	{ return _a; }
-		public function get b() : Number	{ return _b; }
-		public function get c() : Number	{ return _c; }
-		public function get d() : Number	{ return _d; }
+		public function get a() : Number
+		{
+			return _a;
+		}
+		public function get b() : Number
+		{
+			return _b;
+		}
+		public function get c() : Number
+		{
+			return _c;
+		}
+		public function get d() : Number
+		{
+			return _d;
+		}

 		public function get normal() : Vector4
 		{
@@ -177,9 +189,11 @@
 			var scale : Number = _a * v.x + _b * v.y + _c * v.z;

 			out ||= new Vector4();
-			out.set(v._vector.x - scale * _a,
-					v._vector.y - scale * _b,
-					v._vector.z - scale * _c);
+			out.set(
+				v._vector.x - scale * _a,
+				v._vector.y - scale * _b,
+				v._vector.z - scale * _c
+			);

 			return out;
 		}
@@ -248,13 +262,13 @@
 		 * @param	myTarget
 		 * @return
 		 */
-		public final function testRay(origin 	: Vector4,
-									  target	: Vector4) : uint
-		{
-			var distOrigin : Number = _a * origin._vector.x + _b * origin._vector.y + _c * origin._vector.z - _d;
-			var distTarget : Number = _a * target._vector.x + _b * target._vector.y + _c * target._vector.z - _d;
-
-			var r : uint = 0;
+		public final function testRay(ray : Ray) : uint
+		{
+			var origin		: Vector4 	= ray.origin;
+			var target		: Vector4	= ray.direction;
+			var distOrigin 	: Number 	= _a * origin._vector.x + _b * origin._vector.y + _c * origin._vector.z - _d;
+			var distTarget 	: Number 	= _a * target._vector.x + _b * target._vector.y + _c * target._vector.z - _d;
+			var r 			: uint 		= 0;

 			if (distOrigin > 0.)
 				r &= A_INFRONT;


Selection Model should send selectedIndexChanged as well when selectedItem changed

--- frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.as
+++ frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ArraySelectionModel.as
@@ -87,6 +87,7 @@
 				}
 			}
 			dispatchEvent(new Event("selectedItemChanged"));
+			dispatchEvent(new Event("selectedIndexChanged"));
 		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18712
Author:   hmuller@adobe.com
Date:     2010-11-18T19:23:06.057683Z

Log Message:
-----------
Updated TBD items for GridLayout, GridColumnHeaderGroupLayout

API changes (most of *these were supposed have been included in SVN 18691):

- Added IGridItemRenderer/get columnIndex(), get grid()

- *Added DataGrid,Grid/invalidateCell()

- *Added GridItemRenderer/get columnIndex()

- *Renamed the following protected Grid methods:
grid_RollOverHandler() => grid_rollOverHandler()
grid_RollOutHandler() => grid_rollOutHandler()
grid_MouseUpHandler() => grid_mouseUpHandler()
grid_MouseDownHandler() => grid_mouseDownHandler()

QE notes:
Doc notes:
Bugs:
Reviewer: Kevin
Tests run: checkin, mustella
Is noteworthy for integration: yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/IGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/TextFieldGridItemRendererInclude.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/gridClasses/GridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>

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

--- frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridColumnHeaderGroupLayout.as
@@ -32,7 +32,15 @@
 [ExcludeClass]

 /**
- *  TBD
+ *  @private
+ *  Virtual horizontal layout for GridColumnHeaderGroup.  This is not a general
+ *  purpose layout class, it's only intended for GridColumnHeaderGroup, a DataGrid
+ *  skin part.
+ *
+ *  This layout's measuredWidth is essentially zero because the DataGrid's grid
+ *  dictates the overall measured width.  The columnHeaderGroup only contributes
+ *  to the DataGrid's measured height.
+ *
  */
 public class GridColumnHeaderGroupLayout extends LayoutBase
 {


update

update

--- src/control/LoadFileDataCommand.as
+++ src/control/LoadFileDataCommand.as
@@ -156,8 +156,8 @@
 						break;
 					}
 				case BytesType.ZIP:
-					//try
-					//{
+					try
+					{
 						var object:Object;
 						var images:Object;
 						var zip:Zip = new Zip();
@@ -231,11 +231,11 @@
 							return;
 						}
 						break;
-					//}
-					//catch(_e:Error)
-					//{
-						//break;
-					//}
+					}
+					catch(_e:Error)
+					{
+						break;
+					}
 				default:
 					break;
 			}


Match changes to DSet.java streaming implementation.

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

--- src/as/com/threerings/presents/dobj/DSet.as
+++ src/as/com/threerings/presents/dobj/DSet.as
@@ -222,15 +222,19 @@
     // documentation inherited from interface Streamable
     public function writeObject (out :ObjectOutputStream) :void
     {
-        out.writeObject(_entries);
         out.writeInt(_entries.length);
+        for (var ii :int = 0; ii < _entries.length; ii++) {
+            out.writeObject(_entries[ii]);
+        }
     }

     // documentation inherited from interface Streamable
     public function readObject (ins :ObjectInputStream) :void
     {
-        _entries = (ins.readObject() as TypedArray);
-        _entries.length = ins.readInt(); // then read the length and limit it
+        _entries.length = ins.readInt();
+        for (var ii :int = 0; ii < _entries.length; ii++) {
+            _entries[ii] = ins.readObject();
+        }
     }

     /** The entries of the set (in a sparse array). */


Fixed hierarchy window not updating correctly when component is removed.

--- Bin/Data/Scripts/Editor/EditorSceneWindow.as
+++ Bin/Data/Scripts/Editor/EditorSceneWindow.as
@@ -802,10 +802,7 @@
     Component@ component = eventData["Component"].GetComponent();
     uint index = GetComponentListIndex(component);
     if (index != NO_ITEM)
-    {
-        ListView@ list = hierarchyWindow.GetChild("NodeList", true);
-        list.RemoveItem(index);
-    }
+        hierarchyList.RemoveItem(index);
 }

 void HandleNodeNameChanged(StringHash eventType, VariantMap& eventData)


Change to array/collection encoding. No longer support old style simpleEncoder compat. Arrays will always have a wrapper element now

--- as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
+++ as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
@@ -409,7 +409,8 @@
                 encodeValue(obj[fieldName], propQName, myElement, recurse);
             }
         }
-        else if (typeType == XObjXMLEncoder.IXOBJ_COLLECTION)
+        else if (typeType == XObjXMLEncoder.IXOBJ_COLLECTION
+            || typeType == XObjXMLEncoder.ARRAY_TYPE)
         {
             // link us into the heirarchy so that namespaces
             // will be resolved up the chain correctly
@@ -423,34 +424,41 @@
                 var localName:String = "item";  //assume item unless told otherwise
                 var member:* = obj[j];
                 // look up the right qname to use
-                localName = (obj as IXObjCollection).elementTagForMember(member);
+                if (obj is IXObjCollection)
+                {
+                    localName = (obj as IXObjCollection).elementTagForMember(member);
+                }
+                else
+                {
+                    localName = tagForType(member);
+                }
                 qname = new XObjQName("", localName);
                 encodeValue(member, qname, myElement);
             }
         }
-        else if (typeType == XObjXMLEncoder.ARRAY_TYPE)
-        {
+            /*else if (typeType == XObjXMLEncoder.ARRAY_TYPE)
+            {
             if (simpleEncoderCompatible)
             {
-                // link us into the heirarchy so that namespaces
-                // will be resolved up the chain correctly
-                parentNode.appendChild(myElement);
-                setAttributes(myElement, obj);
-                myElement.nodeName = XObjUtils.encodeElementTag(qname, myElement);
-                qname = new XObjQName("", "item");
+            // link us into the heirarchy so that namespaces
+            // will be resolved up the chain correctly
+            parentNode.appendChild(myElement);
+            setAttributes(myElement, obj);
+            myElement.nodeName = XObjUtils.encodeElementTag(qname, myElement);
+            qname = new XObjQName("", "item");
             }
             else
             {
-                // write array elements directly to the parent (no wrapping element required)
-                myElement = parentNode;
+            // write array elements directly to the parent (no wrapping element required)
+            myElement = parentNode;
             }

             // encode array elements as repeated instances of this elem qname
             for (var i:int=0; i < obj.length; i++)
             {
-                encodeValue(obj[i], qname, myElement);
-            }
-        }
+            encodeValue(obj[i], qname, myElement);
+            }
+            }*/
         else // must be simple type
         {
             parentNode.appendChild(myElement);


Transferred from the Adobe Open Source Subversion Repository

Revision: 15045
Author:   jszeto@adobe.com
Date:     2010-03-26T00:36:05.852496Z

Log Message:
-----------
Merging revision 15044 from 4.x to trunk

Mirroring Window Gripper and DateField bug fixes

http://bugs.adobe.com/jira/browse/SDK-25719 - The gripper does not show up in an MX Window that is mirrored and using flex chrome

Added an mx_internal property to Button to track if the Button should modify the layoutDirection of its skins. MX Window and MX WindowedApplication both set this property to undefined. This is the only skin/icon in the halo and spark framework that inherits its layoutDirection from its parent. All others have layoutDirection of LTR.

http://bugs.adobe.com/jira/browse/SDK-25995 - DateField opens drop down on wrong side when layoutDirection = rtl

Added check if left edge of the dropDown exceeds the left screen bounds.

QE notes: n/a
Doc notes: n/a
Bugs: SDK-25719, SDK-25995
Reviewer: Kevin
Tests run: checkintests, DateField
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as</path>

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

--- frameworks/projects/mx/src/mx/controls/Button.as
+++ frameworks/projects/mx/src/mx/controls/Button.as
@@ -37,6 +37,7 @@
 import mx.core.IFlexModuleFactory;
 import mx.core.IFontContextComponent;
 import mx.core.IInvalidating;
+import mx.core.ILayoutDirectionElement;
 import mx.core.IProgrammaticSkin;
 import mx.core.IStateClient;
 import mx.core.IUIComponent;
@@ -1466,6 +1467,21 @@
     public var selectedField:String = null;

     //----------------------------------
+    //  skinLayoutDirection
+    //----------------------------------
+
+    private var skinLayoutDirectionSet:Boolean = false;
+    private var _skinLayoutDirection:String;
+    /**
+     *  @private
+     */
+    mx_internal function set skinLayoutDirection(value:String):void
+    {
+        skinLayoutDirectionSet = true;
+        _skinLayoutDirection = value;
+    }
+
+    //----------------------------------
     //  stickyHighlighting
     //----------------------------------

@@ -1903,6 +1919,9 @@
                 if (newSkin)
                 {
                     checkedDefaultSkin = true;
+
+                    if (newSkin is ILayoutDirectionElement && skinLayoutDirectionSet)
+                        ILayoutDirectionElement(newSkin).layoutDirection = _skinLayoutDirection;
                 }
             }
         }
@@ -1925,6 +1944,9 @@
                 if (styleableSkin)
                     styleableSkin.styleName = this;

+                if (newSkin is ILayoutDirectionElement && skinLayoutDirectionSet)
+                    ILayoutDirectionElement(newSkin).layoutDirection = _skinLayoutDirection;
+
                 addChild(DisplayObject(newSkin));

                 // Make the skin the proper size for this Button.


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.controls
 {


CLOSED - issue NIVEASECRET-417: PROJECT CLEANUP: page.css aufsplitten
http://j.fork.de:8080/browse/NIVEASECRET-417
CLOSED - issue NIVEASECRET-418: Counterpixel > book of secret > CPs werden schon beim "Seitenanheben" und nicht erst beim Umblättern gezählt
http://j.fork.de:8080/browse/NIVEASECRET-418
- track comment removed in UIComponent

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

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -2651,7 +2651,6 @@

 		protected function track(trackingId : String) : void
 		{
-			log('track: ' + (track));
 			m_rootElement.applicationContext().track(trackingId);
 		}


Send a message to mastermind when releasing a fuse.