- formatted ScrollableMenu before applying patch for infinite loop

--- src/flexlib/controls/ScrollableMenu.as
+++ src/flexlib/controls/ScrollableMenu.as
@@ -1,471 +1,522 @@
 /*
-Copyright (c) 2007 FlexLib Contributors.  See:
-    http://code.google.com/p/flexlib/wiki/ProjectContributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
+   Copyright (c) 2007 FlexLib Contributors.  See:
+   http://code.google.com/p/flexlib/wiki/ProjectContributors
+
+   Permission is hereby granted, free of charge, to any person obtaining a copy of
+   this software and associated documentation files (the "Software"), to deal in
+   the Software without restriction, including without limitation the rights to
+   use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+   of the Software, and to permit persons to whom the Software is furnished to do
+   so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be included in all
+   copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+   SOFTWARE.
+ */

 package flexlib.controls
 {
-	import flash.display.DisplayObjectContainer;
-	import flash.events.Event;
-	import flash.events.MouseEvent;
-	import flash.geom.Point;
-	import flash.utils.clearInterval;
-
-	import mx.collections.ICollectionView;
-	import mx.controls.Menu;
-	import mx.controls.listClasses.IListItemRenderer;
-	import mx.controls.menuClasses.IMenuItemRenderer;
-	import mx.core.Application;
-	import mx.core.EdgeMetrics;
-	import mx.core.ScrollPolicy;
-	import mx.core.mx_internal;
-	import mx.events.ScrollEvent;
-	import mx.managers.PopUpManager;
-
-	use namespace mx_internal;
-
-	[IconFile("ScrollableMenu.png")]
-
-	/**
-	 * An extension of mx.controls.Menu that allows the control to scroll vertically.
-	 *
-	 *
Overrides a few methods and properties so we can re-enable scrolling. The
-	 * Menu control in the Flex framework intentionally disables vertical scrolling.
-	 * This class simply undoes alot of that. We reinstitute normal verticalScrollPolicy
-	 * functionality.

-	 *
-	 * @see mx.controls.Menu
-	 */
-	public class ScrollableMenu extends Menu
-	{
-		public var hideOnActivity:Boolean = true;
-
-		private var bBlockHideEvent:Boolean=false;
-
-		/**
-		 * Constructor
-		 */
-		public function ScrollableMenu()
-		{
-			super();
-		}
-
-		/**
-		 * We have to override the static function createMenu so that we create a
-		 * ScrollableMenu instead of a normal Menu.
-		 */
-		public static function createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean=true):ScrollableMenu
-	    {
-	        var menu:ScrollableMenu = new ScrollableMenu();
-	        menu.tabEnabled = false;
-	        menu.owner = DisplayObjectContainer(Application.application);
-	        menu.showRoot = showRoot;
-	        popUpMenu(menu, parent, mdp);
-	        return menu;
-	    }
-
-
-		/**
-		 * Override the verticalScrollPolicy so we can re-instate scrolling functionality.
-		 *
-		 *
The mx.controls.Menu class overrides setting and getting the verticalScrollPolicy
-		 * Basically setting the verticalScrollPolicy did nothing, and getting it always
-		 * returned ScrollPolicy.OFF. So that's not going to work if we want the menu to scroll.
-		 * Here we reinstate the verticalScrollPolicy setter, and keep a local copy of the value
-		 * in a private variable _verticalScrollPolicy.

-		 *
-		 */
-		override public function get verticalScrollPolicy():String {
-			return this._verticalScrollPolicy;
-		}
-
-		/**
-		 * @private
-		 *
-		 *
This setter is basically a copy of what ScrollControlBase and ListBase do.

-		 */
-		override public function set verticalScrollPolicy(value:String):void {
-			var newPolicy:String = value.toLowerCase();
-
-	        itemsSizeChanged = true;
-
-	        if (_verticalScrollPolicy != newPolicy)
-	        {
-	            _verticalScrollPolicy = newPolicy;
-	            dispatchEvent(new Event("verticalScrollPolicyChanged"));
-	        }
-
-
-        	invalidateDisplayList();
-		}
-
-		/**
-		 * Sub menu instance created by this menu.
-		 */
-		private var subMenu:Menu = null;
-
-		/**
-		 * Overridden to reinstate proper scrolling functionality.
-		 *
-		 *
The Menu class overrode configureScrollBars() and made the function
-		 * do nothing. That means the scrollbars don't know how to draw themselves,
-		 * so here we reinstate configureScrollBars. This is basically a copy of the
-		 * same method from the mx.controls.List class. It would have been nice if
-		 * we could have called this method from down in a subclass of Menu, but AS
-		 * doesn't let us do something like super.super, so instead we have to recreate
-		 * the class here.

-		 * */
-		override protected function configureScrollBars():void
-	    {
-	        var rowCount:int = listItems.length;
-	        if (rowCount == 0) return;
-
-	        // if there is more than one row and it is a partial row we dont count it
-	        if (rowCount > 1 && rowInfo[rowCount - 1].y + rowInfo[rowCount-1].height > listContent.height)
-	            rowCount--;
-
-	        // offset, when added to rowCount, is the index of the dataProvider
-	        // item for that row.  IOW, row 10 in listItems is showing dataProvider
-	        // item 10 + verticalScrollPosition - lockedRowCount - 1;
-	        var offset:int = verticalScrollPosition - lockedRowCount - 1;
-	        // don't count filler rows at the bottom either.
-	        var fillerRows:int = 0;
-	        // don't count filler rows at the bottom either.
-	        while (rowCount && listItems[rowCount - 1].length == 0)
-	        {
-	            if (collection && rowCount + offset >= collection.length)
-	            {
-	                rowCount--;
-	                ++fillerRows;
-	            }
-	            else
-	                break;
-	        }
-
-			/*
-			 This part needs further functions from mx.controls.List that we don't have
-			 access to. What to do? Whatever, I'll just comment it out and cross my fingers
-			 */
-	        // we have to scroll up.  We can't have filler rows unless the scrollPosition is 0
-	        /*
-	        if (verticalScrollPosition > 0 && fillerRows > 0)
-	        {
-	            if (adjustVerticalScrollPositionDownward(Math.max(rowCount, 1)))
-	                return;
-	        }*/
-
-	        var colCount:int = listItems[0].length;
-	        var oldHorizontalScrollBar:Object = horizontalScrollBar;
-	        var oldVerticalScrollBar:Object = verticalScrollBar;
-	        var roundedWidth:int = Math.round(unscaledWidth);
-	        var length:int = collection ? collection.length - lockedRowCount: 0;
-	        var numRows:int = rowCount - lockedRowCount;
-
-	        /* This call is slightly modified from mx.controls.List, but not by much */
-	        setScrollBarProperties(
-	                            Math.round(listContent.width) ,
-	                            roundedWidth, length, numRows);
-	        maxVerticalScrollPosition = Math.max(length - numRows, 0);
-
-	        if (verticalScrollBar) {
-	        	verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, onScroll);
-	        	verticalScrollBar.addEventListener(ScrollEvent.SCROLL, onScroll, false, 0, true);
-	        }
-	    }
-
-		/**
-		 * Callback function called when the menu scroll bar is scrolled
-		 *
-		 * @param event The scroll event
-		 *
-		 */
-		protected function onScroll(event:ScrollEvent):void {
-			if (subMenu) subMenu.hide();
-		}
-
-		/**
-		 * @inheritDoc
-		 *
-		 */
-		override public function hide():void {
-	        if (verticalScrollBar) verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, onScroll);
-	        super.hide();
-		}
-
-		/**
-		 * Clear the menu reference from the menu item renderer
-		 *
-		 * @param row The menu item renderer
-		 *
-		 */
-		protected function clearMenu(row:IMenuItemRenderer):void {
-			var menu:Menu = row.menu;
-	        menu.hide();
-	        clearInterval(menu.closeTimer);
-	        menu.closeTimer = 0;
-	        row.menu = null;
-		}
-
-		/**
-		 * @inheritDoc
-		 *
-		 */
-		override public function set rowCount(value:int):void {
-			// Forces scroll bar to top when row count is removed
-			if (value < 0) verticalScrollPosition = 0;
-			super.rowCount = value;
-		}
-
-	    /**
-	    * Overridden to reinstate proper scrolling functionality.
-	    *
-	    *
We need to override openSubMenu as well, so that any subMenus opened by this Menu controls
-	    * will also be ScrollableMenus and will have the same maxHeight set.

-	    */
-	    override mx_internal function openSubMenu(row:IListItemRenderer):void
-	    {
-	        supposedToLoseFocus = true;
-
-	        var r:Menu = getRootMenu();
-	        var menu:Menu;
-
-			// TRICKY: The default implementation uses the item renderer to store a reference to the menu.
-			//			When all items are visible, it means that all items have an item renderer and thus the logic
-			//			works. However, in a scrollable list, item renderers are recycled so it doesn't make sense to store
-			//			the menu reference on the item renderer. If the item renderer data and the menu data are different,
-			//			it means that the item renderer has been recycled and we are going to clear the menu in order to
-			//			recreate the proper one. BAD IDEA from Adobe to use item renderers to store data!!!!
-			if (row.data) {
-				if (IMenuItemRenderer(row).menu) {
-					// Lets compare with the menu
-					var rendererMenu:Menu = IMenuItemRenderer(row).menu;
-					var newData:ICollectionView = _dataDescriptor.getChildren(row.data);
-					var currentData:ICollectionView = rendererMenu.dataProvider as ICollectionView;
-					if (newData != currentData) clearMenu(row as IMenuItemRenderer);
-				}
-			} else {
-				// No data, clear the menu immediately
-				clearMenu(row as IMenuItemRenderer);
-			}
-
-	        // check to see if the menu exists, if not create it
-	        if (!IMenuItemRenderer(row).menu)
-	        {
-	            menu = createSubMenu();
-		        subMenu = menu;
-
-	            menu.maxHeight = this.maxHeight;
-	            menu.maxWidth = this.maxWidth;
-	            menu.verticalScrollPolicy = this.verticalScrollPolicy;
-	            menu.variableRowHeight = this.variableRowHeight;
-
-	            menu.parentMenu = this;
-	            menu.owner = this;
-	            menu.showRoot = showRoot;
-	            //menu.rowCount = rowCount;
-	            menu.dataDescriptor = r.dataDescriptor;
-	            menu.styleName = r;
-	            menu.labelField = r.labelField;
-	            menu.labelFunction = r.labelFunction;
-	            menu.iconField = r.iconField;
-	            menu.iconFunction = r.iconFunction;
-	            menu.itemRenderer = r.itemRenderer;
-	            menu.rowHeight = r.rowHeight;
-	            menu.scaleY = r.scaleY;
-	            menu.scaleX = r.scaleX;
-
-	            ScrollableMenu(menu).hideOnActivity = hideOnActivity;
-
-	            // if there's data and it has children then add the items
-	            if (row.data &&
-	                _dataDescriptor.isBranch(row.data) &&
-	                _dataDescriptor.hasChildren(row.data))
-	            {
-	                menu.dataProvider = _dataDescriptor.getChildren(row.data);
-	            }
-	            menu.sourceMenuBar = sourceMenuBar;
-	            menu.sourceMenuBarItem = sourceMenuBarItem;
-
-	            IMenuItemRenderer(row).menu = menu;
-	            PopUpManager.addPopUp(menu, r, false);
-	        }
-
-	        super.openSubMenu(row);
-	    }
-
-	    protected function createSubMenu():Menu {
-            return new ScrollableMenu();
-	    }
-
-	    private var xShow:Object=0;
-	    private var yShow:Object=0;
-
-	    override public function show(xShow:Object=null, yShow:Object=null):void {
-	    	// When a sub menu is opened, the openSubMenu function, from the Menu class, receives
-	    	// a MenuItemRenderer as input. The item renderer does not have provision for a scrollbar
-	    	// so, we need to take that into account here if we want the sub-menu to open past the scroll bar.
-	    	if(parentMenu != null) {
-	    		with (parentMenu) {
-					if( (verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO) &&
-						verticalScrollBar && verticalScrollBar.visible) {
-								xShow += verticalScrollBar.width;
-					}
-				}
-	    	}
-
-	    	//configureScrollBars();
-
-	    	/*
-	    	if( (verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO) &&
-					verticalScrollBar && verticalScrollBar.visible) {
-
-					measuredWidth -= verticalScrollBar.width;
-			}
-	    	*/
-	    	this.xShow = xShow;
-	    	this.yShow = yShow;
-
-	    	super.show(xShow, yShow);
-
-	    	if(x+width >= screen.width-12) {
-	    		x = screen.width-width - 12;
-	    	}
-	    }
-
-	    /**
-	    * We overide the measure() method because we need to check if the menu is going off
-	    * the stage. If it's going to be too high, then we make it smaller to keep it from
-	    * going off. I also stuck in a buffer of 10 pixels from the bottom of the stage.
-	    *
-	    * We also check if we're showing the vertical scrollbar, and if so we adjust the
-	    * width to account for that.
-	    */
-	    override protected function measure():void
-	    {
-	        super.measure();
-
-			if (explicitRowCount < 1) {
-				// Number of rows was not explicitly set so limit menu height to max height and
-				if(measuredHeight > this.maxHeight) measuredHeight = this.maxHeight;
-
-			} else {
-				// Number of rows was explicitely set. Just make sure that the height of the menu does not go beyond the
-				// maximum height
-		        var o:EdgeMetrics = viewMetrics;
-
-		        var rc:int = 0;
-		        if (!isNaN(explicitRowHeight))
-		        {
-		        	rc = Math.min(int(maxHeight/explicitRowHeight), explicitRowCount, dataProvider.length);
-		            measuredHeight = explicitRowHeight * rc + o.top + o.bottom;
-		            measuredMinHeight = explicitRowHeight * Math.min(rc, 2) +
-		                                o.top + o.bottom;
-		        }
-		        else
-		        {
-		        	rc = Math.min(int(maxHeight/rowHeight), explicitRowCount, dataProvider.length);
-		            measuredHeight = rowHeight * rc + o.top + o.bottom;
-		            measuredMinHeight = rowHeight * Math.min(rc, 2) +
-		                                o.top + o.bottom;
-		        }
-			}
-
-	        // Factor in scrollbars.
-			if(verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO) {
-				if(verticalScrollBar && verticalScrollBar.visible) {
-		            measuredWidth += verticalScrollBar.minWidth;
-		            measuredMinWidth += verticalScrollBar.minWidth;
-				}
-			}
-
-			var pt:Point = new Point(0,0);
-			pt = this.localToGlobal(pt);
-
-			var stageHeightAvailable:Number = screen.y + screen.height - pt.y - 10;
-			if(stageHeightAvailable < measuredHeight) {
-				measuredHeight = measuredMinHeight = stageHeightAvailable;
-			}
-
-			commitProperties();
-		}
-
-	    /**
-	     *  @inheritDoc
-	     */
-		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
-			// The standard implementation draws a mask using a rectangle, it doesn't take into
-			// account that the border can have rounded corners. So, redraw the mask properly,
-			// this time taking into account the rounded corners.
-			var cornerRadius:Number = (getStyle("cornerRadius")) ? getStyle("cornerRadius") : 0;
-			with (maskShape) {
-				graphics.clear();
-				graphics.beginFill(0xFFFFFF);	// Color is not important, it's a mask
-				if (verticalScrollBar && verticalScrollBar.visible) {
-					// The menu has scroll bars so only the upper and bottom left corners are rounded
-					graphics.drawRoundRectComplex(0,0,unscaledWidth, unscaledHeight, cornerRadius, 0, cornerRadius, 0);
-
-				} else {
-					// The menu has NO scroll bars so all corners are rounded
-					graphics.drawRoundRect(0,0,unscaledWidth, unscaledHeight, 2 * cornerRadius, 2 * cornerRadius);
-				}
-				graphics.endFill();
-			}
-
-			var hadVertScroll:Boolean = verticalScrollBar != null && verticalScrollBar.visible;
-
-			// Continue with super class
-			super.updateDisplayList(unscaledWidth, unscaledHeight);
-		}
-
-		override protected function mouseUpHandler(event:MouseEvent):void {
-	    	if(hideOnActivity == false) {
-	    		bBlockHideEvent = true;
-	    	}
-
-	    	super.mouseUpHandler(event);
-
-	    	if(hideOnActivity == false) {
-	    		bBlockHideEvent = false;
-	    	}
-	    }
-
-	    override mx_internal function hideAllMenus():void {
-	    	if(bBlockHideEvent == false) {
-	    		super.hideAllMenus();
-	    	}
-	    }
-
-	    /**
-	     *  @inheritDoc
-	     */
-		override public function move(x:Number, y:Number):void {
-			invalidateSize();
-			super.move(x, y);
-		}
-
-		override public function set dataProvider(value:Object):void {
-			super.dataProvider = value;
-
-			invalidateSize();
-			invalidateDisplayList();
-		}
-	}
+  import flash.display.DisplayObjectContainer;
+  import flash.events.Event;
+  import flash.events.MouseEvent;
+  import flash.geom.Point;
+  import flash.utils.clearInterval;
+
+  import mx.collections.ICollectionView;
+  import mx.controls.Menu;
+  import mx.controls.listClasses.IListItemRenderer;
+  import mx.controls.menuClasses.IMenuItemRenderer;
+  import mx.core.Application;
+  import mx.core.EdgeMetrics;
+  import mx.core.ScrollPolicy;
+  import mx.core.mx_internal;
+  import mx.events.ScrollEvent;
+  import mx.managers.PopUpManager;
+
+  use namespace mx_internal;
+
+  [IconFile("ScrollableMenu.png")]
+
+  /**
+   * An extension of mx.controls.Menu that allows the control to scroll vertically.
+   *
+   *
Overrides a few methods and properties so we can re-enable scrolling. The
+   * Menu control in the Flex framework intentionally disables vertical scrolling.
+   * This class simply undoes alot of that. We reinstitute normal verticalScrollPolicy
+   * functionality.

+   *
+   * @see mx.controls.Menu
+   */
+  public class ScrollableMenu extends Menu
+  {
+    public var hideOnActivity:Boolean = true;
+
+    private var bBlockHideEvent:Boolean = false;
+
+    /**
+     * Constructor
+     */
+    public function ScrollableMenu()
+    {
+      super();
+    }
+
+    /**
+     * We have to override the static function createMenu so that we create a
+     * ScrollableMenu instead of a normal Menu.
+     */
+    public static function createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean=true):ScrollableMenu
+    {
+      var menu:ScrollableMenu = new ScrollableMenu();
+      menu.tabEnabled = false;
+      menu.owner = DisplayObjectContainer(Application.application);
+      menu.showRoot = showRoot;
+      popUpMenu(menu, parent, mdp);
+      return menu;
+    }
+
+
+    /**
+     * Override the verticalScrollPolicy so we can re-instate scrolling functionality.
+     *
+     *
The mx.controls.Menu class overrides setting and getting the verticalScrollPolicy
+     * Basically setting the verticalScrollPolicy did nothing, and getting it always
+     * returned ScrollPolicy.OFF. So that's not going to work if we want the menu to scroll.
+     * Here we reinstate the verticalScrollPolicy setter, and keep a local copy of the value
+     * in a private variable _verticalScrollPolicy.

+     *
+     */
+    override public function get verticalScrollPolicy():String
+    {
+      return this._verticalScrollPolicy;
+    }
+
+    /**
+     * @private
+     *
+     *
This setter is basically a copy of what ScrollControlBase and ListBase do.

+     */
+    override public function set verticalScrollPolicy(value:String):void
+    {
+      var newPolicy:String = value.toLowerCase();
+
+      itemsSizeChanged = true;
+
+      if (_verticalScrollPolicy != newPolicy)
+      {
+        _verticalScrollPolicy = newPolicy;
+        dispatchEvent(new Event("verticalScrollPolicyChanged"));
+      }
+
+      invalidateDisplayList();
+    }
+
+    /**
+     * Sub menu instance created by this menu.
+     */
+    private var subMenu:Menu = null;
+
+    /**
+     * Overridden to reinstate proper scrolling functionality.
+     *
+     *
The Menu class overrode configureScrollBars() and made the function
+     * do nothing. That means the scrollbars don't know how to draw themselves,
+     * so here we reinstate configureScrollBars. This is basically a copy of the
+     * same method from the mx.controls.List class. It would have been nice if
+     * we could have called this method from down in a subclass of Menu, but AS
+     * doesn't let us do something like super.super, so instead we have to recreate
+     * the class here.

+     * */
+    override protected function configureScrollBars():void
+    {
+      var rowCount:int = listItems.length;
+      if (rowCount == 0)
+      {
+        return;
+      }
+
+      // if there is more than one row and it is a partial row we dont count it
+      if (rowCount > 1 && rowInfo[rowCount - 1].y + rowInfo[rowCount - 1].height > listContent.height)
+      {
+        rowCount--;
+      }
+
+      // offset, when added to rowCount, is the index of the dataProvider
+      // item for that row.  IOW, row 10 in listItems is showing dataProvider
+      // item 10 + verticalScrollPosition - lockedRowCount - 1;
+      var offset:int = verticalScrollPosition - lockedRowCount - 1;
+      // don't count filler rows at the bottom either.
+      var fillerRows:int = 0;
+      // don't count filler rows at the bottom either.
+      while (rowCount && listItems[rowCount - 1].length == 0)
+      {
+        if (collection && rowCount + offset >= collection.length)
+        {
+          rowCount--;
+          ++fillerRows;
+        }
+        else
+        {
+          break;
+        }
+      }
+
+      /*
+         This part needs further functions from mx.controls.List that we don't have
+         access to. What to do? Whatever, I'll just comment it out and cross my fingers
+       */
+      // we have to scroll up.  We can't have filler rows unless the scrollPosition is 0
+      /*
+         if (verticalScrollPosition > 0 && fillerRows > 0)
+         {
+         if (adjustVerticalScrollPositionDownward(Math.max(rowCount, 1)))
+         return;
+       }*/
+
+      var colCount:int = listItems[0].length;
+      var oldHorizontalScrollBar:Object = horizontalScrollBar;
+      var oldVerticalScrollBar:Object = verticalScrollBar;
+      var roundedWidth:int = Math.round(unscaledWidth);
+      var length:int = collection ? collection.length - lockedRowCount : 0;
+      var numRows:int = rowCount - lockedRowCount;
+
+      /* This call is slightly modified from mx.controls.List, but not by much */
+      setScrollBarProperties(Math.round(listContent.width), roundedWidth, length, numRows);
+      maxVerticalScrollPosition = Math.max(length - numRows, 0);
+
+      if (verticalScrollBar)
+      {
+        verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, onScroll);
+        verticalScrollBar.addEventListener(ScrollEvent.SCROLL, onScroll, false, 0, true);
+      }
+    }
+
+    /**
+     * Callback function called when the menu scroll bar is scrolled
+     *
+     * @param event The scroll event
+     *
+     */
+    protected function onScroll(event:ScrollEvent):void
+    {
+      if (subMenu)
+      {
+        subMenu.hide();
+      }
+    }
+
+    /**
+     * @inheritDoc
+     *
+     */
+    override public function hide():void
+    {
+      if (verticalScrollBar)
+      {
+        verticalScrollBar.removeEventListener(ScrollEvent.SCROLL, onScroll);
+      }
+      super.hide();
+    }
+
+    /**
+     * Clear the menu reference from the menu item renderer
+     *
+     * @param row The menu item renderer
+     *
+     */
+    protected function clearMenu(row:IMenuItemRenderer):void
+    {
+      var menu:Menu = row.menu;
+      menu.hide();
+      clearInterval(menu.closeTimer);
+      menu.closeTimer = 0;
+      row.menu = null;
+    }
+
+    /**
+     * @inheritDoc
+     *
+     */
+    override public function set rowCount(value:int):void
+    {
+      // Forces scroll bar to top when row count is removed
+      if (value < 0)
+      {
+        verticalScrollPosition = 0;
+      }
+      super.rowCount = value;
+    }
+
+    /**
+     * Overridden to reinstate proper scrolling functionality.
+     *
+     *
We need to override openSubMenu as well, so that any subMenus opened by this Menu controls
+     * will also be ScrollableMenus and will have the same maxHeight set.

+     */
+    override mx_internal function openSubMenu(row:IListItemRenderer):void
+    {
+      supposedToLoseFocus = true;
+
+      var r:Menu = getRootMenu();
+      var menu:Menu;
+
+      // TRICKY: The default implementation uses the item renderer to store a reference to the menu.
+      //			When all items are visible, it means that all items have an item renderer and thus the logic
+      //			works. However, in a scrollable list, item renderers are recycled so it doesn't make sense to store
+      //			the menu reference on the item renderer. If the item renderer data and the menu data are different,
+      //			it means that the item renderer has been recycled and we are going to clear the menu in order to
+      //			recreate the proper one. BAD IDEA from Adobe to use item renderers to store data!!!!
+      if (row.data)
+      {
+        if (IMenuItemRenderer(row).menu)
+        {
+          // Lets compare with the menu
+          var rendererMenu:Menu = IMenuItemRenderer(row).menu;
+          var newData:ICollectionView = _dataDescriptor.getChildren(row.data);
+          var currentData:ICollectionView = rendererMenu.dataProvider as ICollectionView;
+          if (newData != currentData)
+          {
+            clearMenu(row as IMenuItemRenderer);
+          }
+        }
+      }
+      else
+      {
+        // No data, clear the menu immediately
+        clearMenu(row as IMenuItemRenderer);
+      }
+
+      // check to see if the menu exists, if not create it
+      if (!IMenuItemRenderer(row).menu)
+      {
+        menu = createSubMenu();
+        subMenu = menu;
+
+        menu.maxHeight = this.maxHeight;
+        menu.maxWidth = this.maxWidth;
+        menu.verticalScrollPolicy = this.verticalScrollPolicy;
+        menu.variableRowHeight = this.variableRowHeight;
+
+        menu.parentMenu = this;
+        menu.owner = this;
+        menu.showRoot = showRoot;
+        //menu.rowCount = rowCount;
+        menu.dataDescriptor = r.dataDescriptor;
+        menu.styleName = r;
+        menu.labelField = r.labelField;
+        menu.labelFunction = r.labelFunction;
+        menu.iconField = r.iconField;
+        menu.iconFunction = r.iconFunction;
+        menu.itemRenderer = r.itemRenderer;
+        menu.rowHeight = r.rowHeight;
+        menu.scaleY = r.scaleY;
+        menu.scaleX = r.scaleX;
+
+        ScrollableMenu(menu).hideOnActivity = hideOnActivity;
+
+        // if there's data and it has children then add the items
+        if (row.data && _dataDescriptor.isBranch(row.data) && _dataDescriptor.hasChildren(row.data))
+        {
+          menu.dataProvider = _dataDescriptor.getChildren(row.data);
+        }
+        menu.sourceMenuBar = sourceMenuBar;
+        menu.sourceMenuBarItem = sourceMenuBarItem;
+
+        IMenuItemRenderer(row).menu = menu;
+        PopUpManager.addPopUp(menu, r, false);
+      }
+
+      super.openSubMenu(row);
+    }
+
+    protected function createSubMenu():Menu
+    {
+      return new ScrollableMenu();
+    }
+
+    private var xShow:Object = 0;
+    private var yShow:Object = 0;
+
+    override public function show(xShow:Object=null, yShow:Object=null):void
+    {
+      // When a sub menu is opened, the openSubMenu function, from the Menu class, receives
+      // a MenuItemRenderer as input. The item renderer does not have provision for a scrollbar
+      // so, we need to take that into account here if we want the sub-menu to open past the scroll bar.
+      if (parentMenu != null)
+      {
+        with (parentMenu)
+        {
+          if ((verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO) &&
+            verticalScrollBar && verticalScrollBar.visible)
+          {
+            xShow += verticalScrollBar.width;
+          }
+        }
+      }
+
+      //configureScrollBars();
+
+      /*
+         if( (verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO) &&
+         verticalScrollBar && verticalScrollBar.visible) {
+
+         measuredWidth -= verticalScrollBar.width;
+         }
+       */
+      this.xShow = xShow;
+      this.yShow = yShow;
+
+      super.show(xShow, yShow);
+
+      if (x + width >= screen.width - 12)
+      {
+        x = screen.width - width - 12;
+      }
+    }
+
+    /**
+     * We overide the measure() method because we need to check if the menu is going off
+     * the stage. If it's going to be too high, then we make it smaller to keep it from
+     * going off. I also stuck in a buffer of 10 pixels from the bottom of the stage.
+     *
+     * We also check if we're showing the vertical scrollbar, and if so we adjust the
+     * width to account for that.
+     */
+    override protected function measure():void
+    {
+      super.measure();
+
+      if (explicitRowCount < 1)
+      {
+        // Number of rows was not explicitly set so limit menu height to max height and
+        if (measuredHeight > this.maxHeight)
+        {
+          measuredHeight = this.maxHeight;
+        }
+      }
+      else
+      {
+        // Number of rows was explicitely set. Just make sure that the height of the menu does not go beyond the
+        // maximum height
+        var o:EdgeMetrics = viewMetrics;
+
+        var rc:int = 0;
+        if (!isNaN(explicitRowHeight))
+        {
+          rc = Math.min(int(maxHeight / explicitRowHeight), explicitRowCount, dataProvider.length);
+          measuredHeight = explicitRowHeight * rc + o.top + o.bottom;
+          measuredMinHeight = explicitRowHeight * Math.min(rc, 2) +
+            o.top + o.bottom;
+        }
+        else
+        {
+          rc = Math.min(int(maxHeight / rowHeight), explicitRowCount, dataProvider.length);
+          measuredHeight = rowHeight * rc + o.top + o.bottom;
+          measuredMinHeight = rowHeight * Math.min(rc, 2) +
+            o.top + o.bottom;
+        }
+      }
+
+      // Factor in scrollbars.
+      if (verticalScrollPolicy == ScrollPolicy.ON || verticalScrollPolicy == ScrollPolicy.AUTO)
+      {
+        if (verticalScrollBar && verticalScrollBar.visible)
+        {
+          measuredWidth += verticalScrollBar.minWidth;
+          measuredMinWidth += verticalScrollBar.minWidth;
+        }
+      }
+
+      var pt:Point = new Point(0, 0);
+      pt = this.localToGlobal(pt);
+
+      var stageHeightAvailable:Number = screen.y + screen.height - pt.y - 10;
+      if (stageHeightAvailable < measuredHeight)
+      {
+        measuredHeight = measuredMinHeight = stageHeightAvailable;
+      }
+
+      commitProperties();
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+      // The standard implementation draws a mask using a rectangle, it doesn't take into
+      // account that the border can have rounded corners. So, redraw the mask properly,
+      // this time taking into account the rounded corners.
+      var cornerRadius:Number = (getStyle("cornerRadius")) ? getStyle("cornerRadius") : 0;
+      with (maskShape)
+      {
+        graphics.clear();
+        graphics.beginFill(0xFFFFFF); // Color is not important, it's a mask
+        if (verticalScrollBar && verticalScrollBar.visible)
+        {
+          // The menu has scroll bars so only the upper and bottom left corners are rounded
+          graphics.drawRoundRectComplex(0, 0, unscaledWidth, unscaledHeight, cornerRadius, 0, cornerRadius,
+                                        0);
+        }
+        else
+        {
+          // The menu has NO scroll bars so all corners are rounded
+          graphics.drawRoundRect(0, 0, unscaledWidth, unscaledHeight, 2 * cornerRadius, 2 * cornerRadius);
+        }
+        graphics.endFill();
+      }
+
+      var hadVertScroll:Boolean = verticalScrollBar != null && verticalScrollBar.visible;
+
+      // Continue with super class
+      super.updateDisplayList(unscaledWidth, unscaledHeight);
+    }
+
+    override protected function mouseUpHandler(event:MouseEvent):void
+    {
+      if (hideOnActivity == false)
+      {
+        bBlockHideEvent = true;
+      }
+
+      super.mouseUpHandler(event);
+
+      if (hideOnActivity == false)
+      {
+        bBlockHideEvent = false;
+      }
+    }
+
+    override mx_internal function hideAllMenus():void
+    {
+      if (bBlockHideEvent == false)
+      {
+        super.hideAllMenus();
+      }
+    }
+
+    /**
+     *  @inheritDoc
+     */
+    override public function move(x:Number, y:Number):void
+    {
+      invalidateSize();
+      super.move(x, y);
+    }
+
+    override public function set dataProvider(value:Object):void
+    {
+      super.dataProvider = value;
+
+      invalidateSize();
+      invalidateDisplayList();
+    }
+  }
 }


Add support for ArrayList type in CopyUtil.

--- dolly-framework/src/main/actionscript/dolly/utils/CopyUtil.as
+++ dolly-framework/src/main/actionscript/dolly/utils/CopyUtil.as
@@ -1,11 +1,16 @@
 package dolly.utils {

 import mx.collections.ArrayCollection;
+import mx.collections.ArrayList;

 public class CopyUtil {

 	private static function copyArray(targetObj:*, propertyName:String, sourceProperty:*):void {
 		targetObj[propertyName] = (sourceProperty as Array).slice();
+	}
+
+	private static function copyArrayList(targetObj:*, propertyName:String, arrayList:ArrayList):void {
+		targetObj[propertyName] = arrayList.source ? new ArrayList(arrayList.source) : new ArrayList();
 	}

 	private static function copyArrayCollection(targetObj:*, propertyName:String, sourceProperty:*):void {
@@ -27,6 +32,11 @@
 			return;
 		}

+		if (sourceProperty is ArrayList) {
+			copyArrayList(targetObj, propertyName, sourceObj);
+			return;
+		}
+
 		if (sourceProperty is ArrayCollection) {
 			copyArrayCollection(targetObj, propertyName, sourceProperty);
 			return;
@@ -43,6 +53,11 @@
 			return;
 		}

+		if (sourceProperty is ArrayList) {
+			copyArrayList(targetObj, propertyName, sourceProperty);
+			return;
+		}
+
 		if (sourceProperty is ArrayCollection) {
 			copyArrayCollection(targetObj, propertyName, sourceProperty);
 			return;


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

--- frameworks/projects/framework/src/mx/accessibility/AccImpl.as
+++ frameworks/projects/framework/src/mx/accessibility/AccImpl.as
@@ -0,0 +1,290 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.accessibility
+{
+
+import flash.accessibility.Accessibility;
+import flash.accessibility.AccessibilityImplementation;
+import flash.accessibility.AccessibilityProperties;
+import flash.events.Event;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ *  The AccImpl class is the base class for accessibility in components.
+ *  AccImpl supports system roles, object based events, and states.
+ *
+ *  @helpid 3001
+ *  @tiptext The base class for accessibility in components.
+ */
+public class AccImpl extends AccessibilityImplementation
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Default state for all the components.
+	 */
+	private static const STATE_SYSTEM_NORMAL:uint = 0x00000000;
+
+	/**
+	 *  @private
+	 */
+	private static const STATE_SYSTEM_FOCUSABLE:uint = 0x00100000;
+
+	/**
+	 *  @private
+	 */
+	private static const STATE_SYSTEM_FOCUSED:uint = 0x00000004;
+
+	/**
+	 *  @private
+	 */
+	private static const STATE_SYSTEM_UNAVAILABLE:uint = 0x00000001;
+
+	/**
+	 *  @private
+	 */
+	private static const EVENT_OBJECT_NAMECHANGE:uint = 0x800C;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  All subclasses must implement this function.
+	 */
+	mx_internal static function createAccessibilityImplementation(
+								component:UIComponent):void
+	{
+	}
+
+	/**
+	 *  Method call for enabling accessibility for a component.
+	 *  This method is required for the compiler to activate
+	 *  the accessibility classes for a component.
+	 */
+	public static function enableAccessibility():void
+	{
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param master The UIComponent instance that this AccImpl instance
+	 *  is making accessible.
+	 */
+	public function AccImpl(master:UIComponent)
+	{
+		super();
+
+		this.master = master;
+
+		stub = false;
+
+		// Hook in UIComponentAccImpl setup here!
+		master.accessibilityProperties = new AccessibilityProperties();
+
+		// Hookup events to listen for
+		var events:Array = eventsToHandle;
+		if (events)
+		{
+			var n:int = events.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				master.addEventListener(events[i], eventHandler);
+			}
+		}
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  A reference to the UIComponent instance that this AccImpl instance
+	 *  is making accessible.
+	 */
+	protected var master:UIComponent;
+
+	/**
+	 *  Accessibility Role of the component being made accessible.
+	 *  @review
+	 */
+	protected var role:uint;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  All subclasses must override this function by returning an array
+	 *  of strings of the events to listen for.
+	 */
+	protected function get eventsToHandle():Array
+	{
+		return [ "errorStringChanged", "toolTipChanged" ];
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: AccessibilityImplementation
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Returns the system role for the component.
+	 *
+	 *  @param childID uint.
+	 *
+	 *  @return Role associated with the component.
+	 *
+	 *  @tiptext Returns the system role for the component
+	 *  @helpid 3000
+	 */
+	override public function get_accRole(childID:uint):uint
+	{
+		return role;
+	}
+
+	/**
+	 *  @private
+	 *  Returns the name of the component.
+	 *
+	 *  @param childID uint.
+	 *
+	 *  @return Name of the component.
+	 *
+	 *  @tiptext Returns the name of the component
+	 *  @helpid 3000
+	 */
+	override public function get_accName(childID:uint):String
+	{
+		var accName:String = UIComponentAccImpl.getFormName(master);
+
+		if (childID == 0 && master.accessibilityProperties
+			&& master.accessibilityProperties.name
+				&& master.accessibilityProperties.name != "")
+			accName += master.accessibilityProperties.name + " ";
+
+		accName += getName(childID) + getStatusName();
+
+		return (accName != null && accName != "") ? accName : null;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Returns the name of the accessible component.
+	 *  All subclasses must implement this
+	 *  instead of implementing get_accName.
+	 */
+	protected function getName(childID:uint):String
+	{
+		return null;
+	}
+
+	/**
+	 *  Utility method determines state of the accessible component.
+	 */
+	protected function getState(childID:uint):uint
+	{
+		var accState:uint = STATE_SYSTEM_NORMAL;
+
+		if (!UIComponent(master).enabled)
+			accState |= STATE_SYSTEM_UNAVAILABLE;
+		else
+		{
+			accState |= STATE_SYSTEM_FOCUSABLE
+
+			if (UIComponent(master) == UIComponent(master).getFocus())
+				accState |= STATE_SYSTEM_FOCUSED;
+		}
+
+		return accState;
+	}
+
+	/**
+	 *  @private
+	 */
+	private function getStatusName():String
+	{
+		var statusName:String = "";
+
+		if (master.toolTip)
+			statusName += " " + master.toolTip;
+
+		if (master is UIComponent && UIComponent(master).errorString)
+			statusName += " " + UIComponent(master).errorString;
+
+		return statusName;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Event handlers
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Generic event handler.
+	 *  All AccImpl subclasses must implement this
+	 *  to listen for events from its master component.
+	 */
+	protected function eventHandler(event:Event):void
+	{
+		switch (event.type)
+		{
+			case "errorStringChanged":
+			{
+				Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE);
+				Accessibility.updateProperties();
+				break;
+			}
+
+			case "toolTipChanged":
+			{
+				Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE);
+				Accessibility.updateProperties();
+				break;
+			}
+		}
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.charts.series.renderData
 {


Update kdp3Lib/src/com/kaltura/kdpfl/view/controls/ToolTipManager.as

Fixed wrong logic when checking if there is a _hookAlignment

--- kdp3Lib/src/com/kaltura/kdpfl/view/controls/ToolTipManager.as
+++ kdp3Lib/src/com/kaltura/kdpfl/view/controls/ToolTipManager.as
@@ -88,7 +88,7 @@
 				_dataTip.align			= "center";

 			//override all settings it set
-			if(!_hookAlignment)
+			if(_hookAlignment)
 				_dataTip.align			= _hookAlignment;


Um.
I'm not sure what I was thinking: we'll never want to auto-recognize
command:// urls in text. In the places where we'll use them we'll
format things ourselves.

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -237,7 +237,6 @@

     /** A regular expression that finds URLs. */
     protected static const URL_REGEXP :RegExp =
-        // recognize some standard protocols, plus 'command', which we use internally
-        new RegExp("(http|https|ftp|command)://\\S+", "i");
+        new RegExp("(http|https|ftp)://\\S+", "i");
 }
 }


fixed bug creating data uris

fixed bug creating data uris

--- WeaveJS/src/weavejs/net/URLRequestUtils.as
+++ WeaveJS/src/weavejs/net/URLRequestUtils.as
@@ -27,7 +27,7 @@
 	{
 		private function byteArrayToDataUri(byteArray:/*Uint8*/Array, mimeType:String):String
 		{
-			return "data:" + (mimeType || '') + ';base64,' + JS.global.btoa(byteArray);
+			return "data:" + (mimeType || '') + ';base64,' + JS.global.btoa(byteArrayToString(byteArray));
 		}

 		private function byteArrayToString(byteArray:/*Uint8*/Array):String


Transferred from the Adobe Open Source Subversion Repository

Revision: 6609
Author:   gruehle@adobe.com
Date:     2009-05-04T22:47:31.285324Z

Log Message:
-----------
Add theme attribute to theme-specific style metadata.

Example of a halo-specific style:
[Style(name="cornerRadius", type="Number", format="Length", inherit="no", theme="halo")]

Example of a spark-specific style:
[Style(name="baseColor", type="uint", format="Color", inherit="yes", theme="spark")]

Style metadata without a theme attribute is theme-agnostic, and works with either spark or halo.

Bugs: SDK-20606

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/FillStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</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/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.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/framework/src/mx/styles/metadata/BarColorStyle.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/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/IconColorStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SelectedFillColorsStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>

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

--- frameworks/projects/mx/src/mx/controls/PopUpButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpButton.as
@@ -230,7 +230,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="symbolColor", type="uint", format="Color", inherit="yes")]
+[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark")]

 //--------------------------------------
 //  Excluded APIs


Turning version into public const

Turning version into public const

Needed for tracking the current version via code

--- src/aerys/minko/Minko.as
+++ src/aerys/minko/Minko.as
@@ -4,7 +4,7 @@

 	public final class Minko
 	{
-		private static const VERSION	: String	= '2.1';
+		public static const VERSION	: String	= '2.1';

 		private static var _logger		: ILogger	= null;
 		private static var _debugLevel	: uint		= 0; // LogLevel.DISABLED;


Spidermonkey test: increase order to 3 so that test does not fail on slow systems

--- test/acceptance/spidermonkey/js1_5/String/regress-56940-01.as
+++ test/acceptance/spidermonkey/js1_5/String/regress-56940-01.as
@@ -65,7 +65,7 @@
 }
 // printStatus(msg);
 // printStatus('Order: ' + order);
-AddTestCase('BigO < 2', true, Boolean(order));
+AddTestCase('BigO < 3', true, order < 3);

 function concat(size)
 {


Roster denyˆ

Roster denyˆ

--- src/org/igniterealtime/xiff/im/Roster.as
+++ src/org/igniterealtime/xiff/im/Roster.as
@@ -517,6 +517,7 @@
 									case RosterExtension.SUBSCRIBE_TYPE_NONE:
 										rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_REVOCATION );
 										rosterEvent.jid = jid;
+										rosterEvent.data = rosterItemVO;
 										dispatchEvent( rosterEvent );
 										break;


dispatch error in case of empty manifest

--- src/org/mangui/hls/loader/LevelLoader.as
+++ src/org/mangui/hls/loader/LevelLoader.as
@@ -224,6 +224,7 @@

         /** Parse First Level Playlist **/
         private function _parseManifest(string : String) : void {
+            var hlsError : HLSError;
             // Check for M3U8 playlist or manifest.
             if (string.indexOf(Manifest.HEADER) == 0) {
                 // 1 level playlist, create unique level and parse playlist
@@ -267,9 +268,13 @@
                             }
                         }
                     }
+                } else {
+                    // manifest start with correct header, but it does not contain any fragment or level info ...
+                    hlsError = new HLSError(HLSError.MANIFEST_PARSING_ERROR, _url, "empty Manifest");
+                    _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
                 }
             } else {
-                var hlsError : HLSError = new HLSError(HLSError.MANIFEST_PARSING_ERROR, _url, "Manifest is not a valid M3U8 file");
+                hlsError = new HLSError(HLSError.MANIFEST_PARSING_ERROR, _url, "Manifest is not a valid M3U8 file");
                 _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
             }
         };


reduce log verbosity

reduce log verbosity

--- src/org/mangui/hls/stream/TagBuffer.as
+++ src/org/mangui/hls/stream/TagBuffer.as
@@ -11,11 +11,13 @@
     import org.mangui.hls.event.HLSEvent;
     import org.mangui.hls.constant.HLSSeekStates;
     import org.mangui.hls.constant.HLSSeekMode;
-    import org.mangui.hls.utils.Log;
     import org.mangui.hls.flv.FLVTag;
     import org.mangui.hls.HLS;
     import org.mangui.hls.HLSSettings;

+    CONFIG::LOGGING {
+        import org.mangui.hls.utils.Log;
+    }
     /*
      * intermediate FLV Tag Buffer
      *  input : FLV tags retrieved from different fragment loaders (video/alt-audio...)
@@ -176,7 +178,9 @@
                 }
                 if (tags.length) {
                     (_hls.stream as HLSNetStream).appendTags(tags);
-                    Log.debug("appending " + tags.length + " tags");
+                    CONFIG::LOGGING {
+                        Log.debug2("appending " + tags.length + " tags");
+                    }
                 }
             }
         }


- bugfix: Regression in focus handling code

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

--- src/reprise/controls/AbstractButton.as
+++ src/reprise/controls/AbstractButton.as
@@ -131,7 +131,10 @@
 		public override function setFocus(value : Boolean, method : String) : void
 		{
 			super.setFocus(value, method);
-			stage.focus = this;
+			if (value && stage)
+			{
+				stage.focus = this;
+			}
 		}


- added count for executed and failed commands

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

--- src/reprise/commands/CompositeCommand.as
+++ src/reprise/commands/CompositeCommand.as
@@ -49,6 +49,14 @@
 		* An internal counter used to have a reliable sorting.
 		*/
 		protected var m_nextResourceId : int;
+		/**
+		* The number of commands which failed execution
+		*/
+		protected var m_numCommandsFailed : int;
+		/**
+		* The number of commands which were executed in total
+		*/
+		protected var m_numCommandsExecuted : int;

@@ -180,6 +188,23 @@
 		{
 			return m_isExecutingAsynchronously;
 		}
+
+		/**
+		* Returns the number of commands executed in total. This number is increased not until
+		* a command completely finished its execution.
+		*/
+		public function numExecutedCommands():int
+		{
+			return m_numCommandsExecuted;
+		}
+
+		/**
+		* Returns the number of commands which failed execution.
+		*/
+		public function numFailedCommands():int
+		{
+			return m_numCommandsFailed;
+		}

 		/**
 		* @inheritDoc
@@ -191,6 +216,8 @@
 			m_isExecutingAsynchronously = false;
 			m_didSucceed = true;
 			m_nextResourceId = 0;
+			m_numCommandsExecuted = 0;
+			m_numCommandsFailed = 0;
 			super.reset();
 		}

@@ -244,8 +271,10 @@
 			else
 			{
 				currentCommand.execute();
+				m_numCommandsExecuted++;
 				if (!currentCommand.didSucceed())
 				{
+					m_numCommandsFailed++;
 					m_didSucceed = false;
 					if (m_abortOnFailure)
 					{
@@ -347,9 +376,11 @@
 			var completedCommand:IAsynchronousCommand =
 				IAsynchronousCommand(e.target);
 			unregisterListenersForAsynchronousCommand(completedCommand);
-			m_currentCommands.remove(e.target);
+			m_currentCommands.remove(e.target);
+			m_numCommandsExecuted++;
 			if (!e.success)
 			{
+				m_numCommandsFailed++;
 				if (m_abortOnFailure)
 				{
 					failGracefully(false);
@@ -370,6 +401,9 @@
 			// cancel makes no difference to us to a unsuccessful command
 			var completeEvent : CommandEvent = new CommandEvent(Event.COMPLETE, true);
 			command_complete(completeEvent);
+			// since execution is counted after a command completed its execution, cancelled
+			// commands don't fall into this category
+			m_numCommandsExecuted--;
 		}
 	}
 }


Add a name attribute

Add a name attribute


Fixed comments for the function asyncResponder()

--- FlexUnit4/src/org/flexunit/async/Async.as
+++ FlexUnit4/src/org/flexunit/async/Async.as
@@ -179,13 +179,13 @@
 		/**
 		 * This method works in a similar fashion to handleEvent, however, it is intended to work with AsyncTokens and Responders as opposed to events.
 		 *
-		 * @param testCase The current asynchronous test case.
-		 * @param responder The responder that will be executed if the timemout period has not been reached.
-		 * @param timeout The length of time, in milliseconds, before the calling the timeoutHandler
-		 * if the eventName event is not dispatched.
-		 * @param passThroughData An Object that can be given information about the current test, this information will be
-		 * available to both the eventHandler and timeoutHandler.
-		 * @param timeoutHandler The function that will be executed if the timeout period is reached.
+		 * @param testCase: The current asynchronous test case.
+		 * @param responder: The responder that will be executed if the timemout period has not been reached.
+		 * @param timeout: The length of time, in milliseconds, before calling the timeoutHandler
+		 * if the rpc event hasn't been dispatched yet.
+		 * @param passThroughData: An Object that can be given information about the current test, this information will be
+		 * available to both the responder and the timeoutHandler.
+		 * @param timeoutHandler: The function that will be executed if the timeout period is reached.
 		 */
 		CONFIG::useFlexClasses
 		public static function asyncResponder( testCase:Object, responder:*, timeout:int, passThroughData:Object = null, timeoutHandler:Function = null ):IResponder {


fixed bug where CSVDataSource would not use data given in the session state.

--- WeaveData/src/weave/data/DataSources/CSVDataSource.as
+++ WeaveData/src/weave/data/DataSources/CSVDataSource.as
@@ -93,6 +93,9 @@
 		}
 		private function parseRawData():void
 		{
+			if (!url.value)
+				return;
+
 			if (rawDataPromise.error)
 				reportError(rawDataPromise.error);


Transferred from the Adobe Open Source Subversion Repository

Revision: 4791
Author:   jimurphy@adobe.com
Date:     2009-02-02T18:41:55.936815Z

Log Message:
-----------
missed this addition in the merge

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexChangeEvent.as

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

--- frameworks/projects/framework/src/mx/events/FlexChangeEvent.as
+++ frameworks/projects/framework/src/mx/events/FlexChangeEvent.as
@@ -0,0 +1,145 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.events
+{
+import flash.events.Event;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ *  The FlexChangeEvent class represents the event object passed to
+ *  an event listener for Flex events that have data associated with
+ *  some change in Flex. The data property provides
+ *  additional information about the event.
+ *
+ */
+public class FlexChangeEvent extends Event
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  The FlexChangeEvent.ADD_CHILD_BRIDGE constant defines the value of the
+     *  type property of the event object for an addChildBridge event.
+     *
+     *  This event is dispatch by a SystemManager after a child SWFBridge has been added. This
+     *  event's data property is a reference to the added SWFBridge.
+     *
+     *  added to the SystemManager.
+     *
+     *
The properties of the event object have the following values:

+     *

+     *
Property	Value

+     *
bubbles	false

+     *
cancelable	false

+     *
currentTarget	The Object that defines the
+     *       event listener that handles the event. For example, if you use
+     *       myButton.addEventListener() to register an event listener,
+     *       myButton is the value of the currentTarget.

+     *
target	The Object that dispatched the event;
+     *       it is not always the Object listening for the event.
+     *       Use the currentTarget property to always access the
+     *       Object listening for the event.

+     *

+     *
+     *  @eventType addChildBridge
+     */
+    public static const ADD_CHILD_BRIDGE:String = "addChildBridge";
+
+    /**
+     *  The FlexChangeEvent.REMOVE_CHILD_BRIDGE constant defines the value of the
+     *  type property of the event object for an removeChildBridge event.
+     *
+     *  This event is dispatch by a SystemManager just before a child SWFBridge is removed. This
+     *  event's data property is a reference to the removed SWFBridge.
+     *
+     *
The properties of the event object have the following values:

+     *

+     *
Property	Value

+     *
bubbles	false

+     *
cancelable	false

+     *
currentTarget	The Object that defines the
+     *       event listener that handles the event. For example, if you use
+     *       myButton.addEventListener() to register an event listener,
+     *       myButton is the value of the currentTarget.

+     *
target	The Object that dispatched the event;
+     *       it is not always the Object listening for the event.
+     *       Use the currentTarget property to always access the
+     *       Object listening for the event.

+     *

+     *
+     *  @eventType removeChildBridge
+     */
+    public static const REMOVE_CHILD_BRIDGE:String = "removeChildBridge";
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param type The event type; indicates the action that caused the event.
+     *
+     *  @param bubbles Specifies whether the event can bubble up the display list hierarchy.
+     *
+     *  @param cancelable Specifies whether the behavior associated with the event can be prevented.
+     *
+     *  @param data Data related to the event.
+     */
+    public function FlexChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object = null)
+    {
+        super(type, bubbles, cancelable);
+
+        this.data = data;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    /**
+     *  Data related to the event. For more information on this object, see each event type.
+     */
+    public var data:Object;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: Event
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function clone():Event
+    {
+        return new FlexChangeEvent(type, bubbles, cancelable, data);
+    }
+
+}
+}