Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as
@@ -0,0 +1,1859 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.collections
+{
+
+import flash.events.EventDispatcher;
+import flash.utils.Dictionary;
+import flash.xml.XMLNode;
+
+import mx.collections.errors.ItemPendingError;
+import mx.core.EventPriority;
+import mx.core.mx_internal;
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;
+import mx.events.PropertyChangeEvent;
+import mx.utils.IXMLNotifiable;
+import mx.utils.UIDUtil;
+import mx.utils.XMLNotifier;
+
+use namespace mx_internal;
+
+/**
+ *  The HierarchicalCollectionView class provides a hierarchical view of a standard collection.
+ *
+ *  @mxml
+ *
+ *  The <mx.HierarchicalCollectionView> inherits all the tag attributes of its superclass,
+ *  and defines the following tag attributes:

+ *
+ *

+ *  <mx:HierarchicalCollectionView
+ *  Properties
+ *    showRoot="true|false"
+ *    source="No default"
+ *  />
+ *

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class HierarchicalCollectionView extends EventDispatcher
+                                        implements IHierarchicalCollectionView, IXMLNotifiable
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param hierarchicalData The data structure containing the hierarchical data.
+     *
+     *  @param argOpenNodes The Object that defines a node to appear as open.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function HierarchicalCollectionView(
+                            hierarchicalData:IHierarchicalData = null,
+                            argOpenNodes:Object = null)
+    {
+        super();
+
+        if (hierarchicalData)
+            initializeCollection(hierarchicalData.getRoot(), hierarchicalData, argOpenNodes);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var hierarchicalData:IHierarchicalData;
+
+    /**
+     *  @private
+     */
+    private var cursor:HierarchicalCollectionViewCursor;
+
+    /**
+     *  @private
+     *  The total number of nodes we know about.
+     */
+    private var currentLength:int;
+
+    /**
+	 *  @private
+	 *  Top level XML node if there is one
+	 */
+	private var parentNode:XML;
+
+    /**
+     *  @private
+     *  Mapping of nodes to children.  Used by getChildren.
+     */
+    private var childrenMap:Dictionary;
+
+    /**
+     *  @private
+     */
+    private var childrenMapCache:Dictionary = new Dictionary(true);
+
+    /**
+     *  @private
+     */
+    mx_internal var treeData:ICollectionView;
+
+    /**
+     *  @private
+     *  Mapping of UID to parents.  Must be maintained as things get removed/added
+     *  This map is created as objects are visited
+     */
+    mx_internal var parentMap:Object;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  hasRoot
+    //----------------------------------
+
+    private var _hasRoot:Boolean;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get hasRoot():Boolean
+    {
+        return _hasRoot;
+    }
+
+    //----------------------------------
+    //  openNodes
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the openNodes property.
+     */
+    private var _openNodes:Object;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get openNodes():Object
+    {
+        return _openNodes;
+    }
+
+    /**
+     *  @private
+     */
+    public function set openNodes(value:Object):void
+    {
+        // openNodes cant be null
+        if (value)
+        {
+            _openNodes = {};
+            for each (var item:* in value)
+            {
+                _openNodes[UIDUtil.getUID(item)] = item;
+            }
+        }
+        else
+            _openNodes = {};
+
+        if (hierarchicalData)
+        {
+            //calc initial length
+            currentLength = calculateLength();
+
+            // need to refresh the collection after setting openNodes
+            var event:CollectionEvent =
+                new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+            event.kind = CollectionEventKind.REFRESH;
+            dispatchEvent(event);
+        }
+    }
+
+    //----------------------------------
+    //  showRoot
+    //----------------------------------
+
+    private var _showRoot:Boolean = true;
+
+    [Bindable]
+    [Inspectable(category="Data", enumeration="true,false", defaultValue="true")]
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get showRoot():Boolean
+    {
+        return _showRoot;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showRoot(value:Boolean):void
+    {
+        if (_showRoot != value)
+        {
+            _showRoot = value;
+            if (hierarchicalData)
+            {
+                initializeCollection(hierarchicalData.getRoot(), hierarchicalData, openNodes);
+
+                //setting showRoot resets the collection
+                var event:CollectionEvent =
+                    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+                event.kind = CollectionEventKind.RESET;
+                dispatchEvent(event);
+            }
+        }
+    }
+
+    //----------------------------------
+    //  source
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get source():IHierarchicalData
+    {
+        return hierarchicalData;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:IHierarchicalData):void
+    {
+        initializeCollection(value.getRoot(), value, openNodes);
+    }
+
+    //----------------------------------
+    //  filter
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the filterFunction property.
+     */
+    private var _filterFunction:Function;
+
+    [Bindable("filterFunctionChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  @private
+     */
+    public function get filterFunction():Function
+    {
+        return _filterFunction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set filterFunction(value:Function):void
+    {
+        _filterFunction = value;
+    }
+
+    //----------------------------------
+    //  length
+    //----------------------------------
+
+    /**
+     *  The length of the currently parsed collection.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get length():int
+    {
+        return currentLength;
+    }
+
+    //----------------------------------
+    //  sort
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the sort property.
+     */
+    private var _sort:Sort;
+
+    [Bindable("sortChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  @private
+     */
+    public function get sort():Sort
+    {
+        return _sort;
+    }
+
+    /**
+     *  @private
+     */
+    public function set sort(value:Sort):void
+    {
+        _sort = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // ICollectionView Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns a new instance of a view iterator over the items in this view.
+     *
+     *  @return IViewCursor instance.
+     *
+     *  @see mx.utils.IViewCursor
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function createCursor():IViewCursor
+    {
+        return new HierarchicalCollectionViewCursor(
+            this, treeData, hierarchicalData);
+    }
+
+    /**
+     *  Checks the collection for the data item using standard equality test.
+     *
+     *  @param item The Object that defines the node to look for.
+     *
+     *  @param true if the collection contains the item,
+     *
+     *  @return true if the data item is in the collection,
+     *  and false if not.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function contains(item:Object):Boolean
+    {
+        var cursor:IViewCursor = createCursor();
+        while (!cursor.afterLast)
+        {
+            if (cursor.current == item)
+                return true;
+
+            try
+            {
+                cursor.moveNext();
+            }
+            catch (e:ItemPendingError)
+            {
+                // item is pending.
+                // we are not sure if the item is present or not,
+                // so return false
+                return false;
+            }
+        }
+        return false;
+    }
+
+    /**
+     *  @private
+     */
+    public function disableAutoUpdate():void
+    {
+        // propogate to all the child collections
+        treeData.disableAutoUpdate();
+        for (var p:Object in childrenMap)
+            ICollectionView(childrenMap[p]).disableAutoUpdate();
+    }
+
+    /**
+     *  @private
+     */
+    public function enableAutoUpdate():void
+    {
+        // propogate to all the child collections
+        treeData.enableAutoUpdate();
+        for (var p:Object in childrenMap)
+            ICollectionView(childrenMap[p]).enableAutoUpdate();
+    }
+
+    /**
+     *  @private
+     */
+    public function itemUpdated(item:Object, property:Object = null,
+                                oldValue:Object = null,
+                                newValue:Object = null):void
+    {
+        var event:CollectionEvent =
+            new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+        event.kind = CollectionEventKind.UPDATE;
+
+        var objEvent:PropertyChangeEvent =
+            new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+        objEvent.source = item;
+        objEvent.property = property;
+        objEvent.oldValue = oldValue;
+        objEvent.newValue = newValue;
+        event.items.push(objEvent);
+
+        dispatchEvent(event);
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function refresh():Boolean
+    {
+        return internalRefresh(true);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // IHierarchicalCollectionView Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getNodeDepth(node:Object):int
+    {
+        var depth:int = 1;
+        var parent:Object = getParentItem(node);
+
+        while(parent != null)
+        {
+        	parent = getParentItem(parent);
+        	depth++;
+        }
+    	depth = (hasRoot && !showRoot) ? (depth - 1) : depth;
+
+        // depth cant be less then 1
+        return (depth < 1) ? 1 : depth;
+    }
+
+    /**
+     *  Returns the parent of a node.
+     *  The parent of a top-level node is null.
+     *
+     *  @param node The Object that defines the node.
+     *
+     *  @return The parent node containing the node,
+     *  null for a top-level node,
+     *  and undefined if the parent cannot be determined.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getParentItem(node:Object):*
+    {
+        var uid:String = UIDUtil.getUID(node);
+        if (parentMap.hasOwnProperty(uid))
+            return parentMap[uid];
+
+        return undefined;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getChildren(node:Object):ICollectionView
+    {
+        // Using uid because XML cant be referenced correctly using Dictionary
+        var uid:String = UIDUtil.getUID(node);
+        var children:* = hierarchicalData.getChildren(node);
+
+        var childrenCollection:ICollectionView = childrenMapCache[uid];
+
+        if (children is XMLList && childrenCollection)
+        {
+            //We don't want to send a RESET type of collectionChange event in this case.
+            XMLListCollection(childrenCollection).mx_internal::dispatchResetEvent = false;
+            XMLListCollection(childrenCollection).source = children;
+
+            // refresh the collection to apply the sort/filter
+            childrenCollection.refresh();
+        }
+
+        // check the cache and return from it.
+        // useful in sorting/filtering.
+        if(childrenCollection)
+        {
+        	// node might have changed, so update the childrenMap
+        	childrenMap[node] = childrenCollection;
+            return childrenCollection;
+        }
+
+        // if there is no children, return null
+        if (!children)
+            return null;
+
+        //then wrap children in ICollectionView if necessary
+        if (children is ICollectionView)
+        {
+            childrenCollection = ICollectionView(children);
+        }
+        else if (children is Array)
+        {
+            childrenCollection = new ArrayCollection(children);
+        }
+        else if (children is XMLList)
+        {
+            childrenCollection =  new XMLListCollection(children);
+        }
+        else
+        {
+            var childArray:Array = new Array(children);
+            if (childArray != null)
+            {
+                childrenCollection =  new ArrayCollection(childArray);
+            }
+        }
+
+        childrenMapCache[uid] = childrenCollection;
+
+
+        var oldChildren:ICollectionView = childrenMap[node];
+        if (oldChildren != childrenCollection)
+        {
+            if (oldChildren != null)
+            {
+                oldChildren.removeEventListener(CollectionEvent.COLLECTION_CHANGE,
+                                      nestedCollectionChangeHandler);
+            }
+            childrenCollection.addEventListener(CollectionEvent.COLLECTION_CHANGE,
+                                          nestedCollectionChangeHandler, false, 0, true);
+            childrenMap[node] = childrenCollection;
+        }
+
+        return childrenCollection;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function openNode(node:Object):void
+    {
+		var uid:String = UIDUtil.getUID(node);
+
+		// check if the node is already opened
+		if (_openNodes[uid] != null)
+			return;
+
+        // add the node to the openNodes object and update the length
+        _openNodes[uid] = node;
+
+        // apply the sort/filter to the child collection of the opened node.
+        var childrenCollection:ICollectionView = getChildren(node);
+
+        // return if there are no children
+        if (!childrenCollection)
+            return;
+
+        if (sortCanBeApplied(childrenCollection) && !(childrenCollection.sort == null && sort == null))
+        {
+            childrenCollection.sort = this.sort;
+        }
+        if (!(childrenCollection.filterFunction == null && filterFunction == null))
+        {
+            childrenCollection.filterFunction = this.filterFunction;
+        }
+        childrenCollection.refresh();
+
+		updateParentMapAndLength(childrenCollection, node);
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function closeNode(node:Object):void
+    {
+        var childrenCollection:ICollectionView = childrenMap[node];
+
+        // removes the node from the openNodes object and update the length
+        delete _openNodes[UIDUtil.getUID(node)];
+
+		if (childrenCollection)
+		{
+			var cursor:IViewCursor = childrenCollection.createCursor();
+			while (!cursor.afterLast)
+			{
+				var uid:String = UIDUtil.getUID(cursor.current);
+				delete parentMap[uid];
+
+				try
+				{
+					cursor.moveNext();
+				}
+				catch (e:ItemPendingError)
+				{
+					break;
+				}
+
+			}
+		}
+
+		// update the length
+		updateLength();
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addChild(parent:Object, newChild:Object):Boolean
+    {
+        if (parent == null)
+            return addChildAt(parent, newChild, treeData.length);
+        else
+            return addChildAt(parent, newChild, getChildren(parent).length);
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function removeChild(parent:Object, child:Object):Boolean
+    {
+        var cursor:IViewCursor;
+        var index:int = 0;
+        if (parent == null)
+        {
+            cursor = treeData.createCursor();
+        }
+        else
+        {
+             var children:ICollectionView = getChildren(parent);
+             cursor = children.createCursor();
+        }
+        while (!cursor.afterLast)
+        {
+            if (cursor.current == child)
+            {
+                cursor.remove();
+                return true;
+            }
+
+            try
+            {
+                cursor.moveNext();
+            }
+            catch (e:ItemPendingError)
+            {
+                // Items are pending - so return false
+                return false;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     *  Add a child node to a node at the specified index.
+     *  This implementation does the following:
+     *
+     *

+     *
If the parent is null or undefined,
+     *          inserts the child at the
+     *          specified index in the collection specified
+     *          by source.
+     *

+     *
If the parent has a children
+     *          field or property, the method adds the child
+     *          to it at the index location.
+     *          In this case, the source is not required.
+     *

+     *
If the parent does not have a children
+     *          field or property, the method adds the children
+     *          to the parent. The method then adds the
+     *          child to the parent at the
+     *          index location.
+     *          In this case, the source is not required.
+     *

+     *
If the index value is greater than the collection
+     *         length or number of children in the parent, adds the object as
+     *         the last child.
+     *

+     *

+     *
+     *  @param node The Object that defines the parent node.
+     *
+     *  @param newChild The Object that defines the child node.
+     *
+     *  @param index The 0-based index of where to insert the child node.
+     *
+     *  @param source The entire collection that this node is a part of.
+     *
+     *  @return true if the child is added successfully.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function addChildAt(parent:Object, newChild:Object, index:int):Boolean
+    {
+        var cursor:IViewCursor;
+        if (!parent)
+        {
+            cursor = treeData.createCursor();
+        }
+        else
+        {
+            if (!hierarchicalData.canHaveChildren(parent))
+                return false;
+
+            var children:ICollectionView = getChildren(parent);
+
+            cursor = children.createCursor();
+        }
+
+        try
+        {
+            cursor.seek(CursorBookmark.FIRST, index);
+        }
+        catch (e:ItemPendingError)
+        {
+            // Item Pending
+            return false;
+        }
+
+        cursor.insert(newChild);
+
+        return true;
+    }
+
+    /**
+     *  Removes the child node from a node at the specified index.
+     *
+     *  @param parent The Object that defines the parent node.
+     *
+     *  @param index The 0-based index of  the child node to remove relative to the parent.
+     *
+     *  @return true if the child is removed successfully.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function removeChildAt(parent:Object, index:int):Boolean
+    {
+        var cursor:IViewCursor;
+        if (!parent)
+        {
+            cursor = treeData.createCursor();
+        }
+        else
+        {
+            var children:ICollectionView = getChildren(parent);
+            cursor = children.createCursor();
+        }
+
+        try
+        {
+            cursor.seek(CursorBookmark.FIRST, index);
+        }
+        catch (e:ItemPendingError)
+        {
+            // Item Pending
+            return false;
+        }
+
+        if (cursor.beforeFirst || cursor.afterLast)
+            return false;
+
+        cursor.remove();
+        return true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     *
+     * returns the collection view of the given object
+     */
+    private function getCollection(value:Object):ICollectionView
+    {
+        // handle strings and xml
+        if (typeof(value)=="string")
+            value = new XML(value);
+        else if (value is XMLNode)
+            value = new XML(XMLNode(value).toString());
+        else if (value is XMLList)
+            value = new XMLListCollection(value as XMLList);
+
+        if (value is XML)
+        {
+            var xl:XMLList = new XMLList();
+            xl += value;
+            return new XMLListCollection(xl);
+        }
+        //if already a collection dont make new one
+        else if (value is ICollectionView)
+        {
+            return ICollectionView(value);
+        }
+        else if (value is Array)
+        {
+            return new ArrayCollection(value as Array);
+        }
+        //all other types get wrapped in an ArrayCollection
+        else if (value is Object)
+        {
+            // convert to an array containing this one item
+            var tmp:Array = [];
+            tmp.push(value);
+            return new ArrayCollection(tmp);
+        }
+        else
+        {
+            return new ArrayCollection();
+        }
+    }
+
+    /**
+     *  @private
+     *
+     *  Initialize the collection. set its various properties and
+     *  update its length.
+     */
+    private function initializeCollection(model:Object,
+                            hierarchicalData:IHierarchicalData,
+                            argOpenNodes:Object = null):void
+    {
+        parentMap = {};
+
+        childrenMap = new Dictionary(true);
+        childrenMapCache = new Dictionary(true);
+
+        if (treeData)
+            treeData.removeEventListener(CollectionEvent.COLLECTION_CHANGE,
+                                         collectionChangeHandler,
+                                         false);
+
+        if (this.hierarchicalData)
+            this.hierarchicalData.removeEventListener(CollectionEvent.COLLECTION_CHANGE,
+                                         collectionChangeHandler,
+                                         false);
+
+        treeData = getCollection(model);
+
+        if (treeData)
+            _hasRoot = treeData.length == 1;
+
+        var tmpCollection:Object = model;
+        // are we swallowing the root?
+        if (hierarchicalData && !showRoot && hasRoot)
+        {
+        	var obj:Object = treeData.createCursor().current;
+            if (hierarchicalData.hasChildren(obj))
+            {
+                // then get rootItem children
+                tmpCollection = hierarchicalData.getChildren(obj);
+                treeData = getCollection(tmpCollection);
+            }
+        }
+
+        // listen for add/remove events from developer as weak reference
+        treeData.addEventListener(CollectionEvent.COLLECTION_CHANGE,
+                                  collectionChangeHandler,
+                                  false,
+                                  EventPriority.DEFAULT_HANDLER,
+                                  true);
+
+        this.hierarchicalData = hierarchicalData;
+
+        // listen for reset/refresh events
+        this.hierarchicalData.addEventListener(
+        							CollectionEvent.COLLECTION_CHANGE,
+                                 	collectionChangeHandler,
+                                 	false,
+                                 	EventPriority.DEFAULT_HANDLER,
+                                 	true);
+
+        // openNodes cant be null
+        if (argOpenNodes)
+            _openNodes = argOpenNodes;
+        else
+            _openNodes = {};
+
+        //calc initial length
+        currentLength = calculateLength();
+    }
+
+	/**
+	 *  @private
+	 *
+	 *  Update the parent map and adjust the length.
+	 */
+	private function updateParentMapAndLength(collection:ICollectionView, node:Object):void
+	{
+		var cursor:IViewCursor = collection.createCursor();
+		currentLength += collection.length;
+
+		while (!cursor.afterLast)
+		{
+			var item:Object = cursor.current;
+			var uid:String = UIDUtil.getUID(item);
+			parentMap[uid] = node;
+
+			// check that the node is opened or not.
+			// If it is open, then update the length with the node's children.
+			if (_openNodes[uid] != null)
+			{
+				var childrenCollection:ICollectionView = getChildren(item);
+				if (childrenCollection)
+					updateParentMapAndLength(childrenCollection, item);
+			}
+
+			try
+			{
+				cursor.moveNext();
+			}
+			catch (e:ItemPendingError)
+			{
+				break;
+			}
+		}
+	}
+
+    /**
+     *  @private
+     *  Calculate the total length of the collection, but only count nodes
+     *  that we can reach.
+     */
+    public function calculateLength(node:Object = null, parent:Object = null):int
+    {
+        var length:int = 0;
+        var childNodes:ICollectionView;
+        var modelOffset:int = 0;
+        var firstNode:Boolean = true;
+
+        if (node == null)
+        {
+            // special case counting the whole thing
+            // watch for page faults
+            var modelCursor:IViewCursor = treeData.createCursor();
+            if (modelCursor.beforeFirst)
+			{
+				// indicates that an IPE occured on the first item
+				return treeData.length;
+			}
+            while (!modelCursor.afterLast)
+            {
+                node = modelCursor.current;
+                if (node is XML)
+				{
+					if (firstNode)
+					{
+						firstNode = false;
+						var parNode:* = node.parent();
+						if (parNode != null)
+						{
+							startTrackUpdates(parNode);
+							childrenMap[parNode] = treeData;
+							parentNode = parNode;
+						}
+					}
+					startTrackUpdates(node);
+				}
+				if (node === null)
+					length += 1;
+				else
+                	length += calculateLength(node, null) + 1;
+                modelOffset++;
+                try
+                {
+                    modelCursor.moveNext();
+                }
+                catch (e:ItemPendingError)
+                {
+                    // just stop where we are, no sense paging
+                    // the whole thing just to get length. make a rough
+                    // guess assuming that all un-paged nodes are closed
+                    length += treeData.length - modelOffset;
+                    return length;
+                }
+            }
+        }
+        else
+        {
+            var uid:String = UIDUtil.getUID(node);
+            parentMap[uid] = parent;
+            if (node != null &&
+                openNodes[uid] &&
+                hierarchicalData.canHaveChildren(node) &&
+                hierarchicalData.hasChildren(node))
+            {
+                childNodes = getChildren(node);
+                if (childNodes != null)
+                {
+                    var childCursor:IViewCursor = childNodes.createCursor();
+                    try
+                    {
+                        childCursor.seek(CursorBookmark.FIRST);
+                        while (!childCursor.afterLast)
+                        {
+                        	if (node is XML)
+								startTrackUpdates(childCursor.current);
+                            length += calculateLength(childCursor.current, node) + 1;
+                            modelOffset++;
+
+                            try
+                            {
+                                childCursor.moveNext();
+                            }
+                            catch (e:ItemPendingError)
+                            {
+                                // just stop where we are, no sense paging
+                                // the whole thing just to get length. make a rough
+                                // guess assuming that all un-paged nodes are closed
+                                length += childNodes.length - modelOffset;
+                                return length;
+                            }
+                        }
+                    }
+                    catch (e:ItemPendingError)
+                    {
+                        // assume that the child collection has one item
+                        length += 1;
+                    }
+                }
+            }
+        }
+        return length;
+    }
+
+    /**
+     *  @private
+     */
+    private function internalRefresh(dispatch:Boolean):Boolean
+    {
+        var obj:Object;
+        var coll:ICollectionView
+        var needUpdate:Boolean = false;
+
+        // apply filter function to all the collections including the child collections
+    	if (!(treeData.filterFunction == null && filterFunction == null))
+    	{
+            treeData.filterFunction = filterFunction;
+            treeData.refresh();
+            needUpdate = true;
+        }
+
+        for each(obj in openNodes)
+        {
+            coll = getChildren(obj);
+            if (coll && !(coll.filterFunction == null && filterFunction == null))
+            {
+                coll.filterFunction = filterFunction;
+                coll.refresh();
+                needUpdate = true
+           	}
+        }
+
+        // if filter is applied to any collection, only then update the length
+        if (needUpdate)
+        	updateLength();  // length will change after filtering, so update it.
+
+
+        // apply sort to all the collections including the child collections
+        if (sortCanBeApplied(treeData) && !(treeData.sort == null && sort == null))
+        {
+            treeData.sort = sort;
+            treeData.refresh();
+            dispatch = true;
+        }
+
+        // recursive sort for every field
+        for each(obj in openNodes)
+        {
+
+            coll = getChildren(obj);
+
+            if (coll && sortCanBeApplied(coll) && !(coll.sort == null && sort == null))
+            {
+                coll.sort = sort;
+                coll.refresh();
+                dispatch = true;
+            }
+        }
+
+        // No concept of a sort level, so commenting the code
+        /* for(var i:int = 0;i<sort.fields.length;i++)
+        {
+            if(sort.fields[i].hasOwnProperty("sortLevel"))
+                sortLevel = sort.fields[i].sortLevel;
+            //else
+                //sortLevel = 1;
+
+
+            if(sortLevel == 1)
+            {
+                var srt:Sort = new Sort();
+
+                if(sort.usingCustomCompareFunction)
+                {
+                    srt.compareFunction = sort.compareFunction;
+                }
+
+                srt.unique = sort.unique;
+
+                srt.fields = [sort.fields[i]];
+                treeData.sort = srt;
+                treeData.refresh();
+            }
+            else
+            {
+                for each(var obj:Object in openNodes)
+                {
+
+                    var depth:int = 2;
+                    var o:Object = obj;
+                    while(getParentItem(o) != null)
+                    {
+                        depth++;
+                        o = getParentItem(o);
+                    }
+
+                    if(depth == sortLevel)
+                    {
+                        var coll:ICollectionView = getChildren(obj);
+
+                        var srt:Sort = new Sort();
+
+                        if(sort.usingCustomCompareFunction)
+                            srt.compareFunction = sort.compareFunction;
+
+                        srt.unique = sort.unique;
+
+                        srt.fields = [sort.fields[i]];
+
+                        coll.sort = srt;
+                        coll.refresh();
+                    }
+                }
+            }
+        } */
+
+        if (dispatch)
+        {
+            var refreshEvent:CollectionEvent =
+                new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+            refreshEvent.kind = CollectionEventKind.REFRESH;
+            dispatchEvent(refreshEvent);
+        }
+        return true;
+    }
+
+    /**
+     * @private
+     * Check if a collection has the properties on which the sort is applied.
+     */
+    private function sortCanBeApplied(coll:ICollectionView):Boolean
+    {
+    	if (sort == null)
+    		return true;
+
+        // get the current item
+        var obj:Object = coll.createCursor().current;
+
+        if (!obj || !sort.fields)
+            return false;
+
+        // check for the properties (sort fields) in the current object
+        for (var i:int = 0; i < sort.fields.length; i++)
+        {
+            var sf:SortField = sort.fields[i];
+            if (!obj.hasOwnProperty(sf.name))
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * @private
+     * Force a recalulation of length
+     */
+     private function updateLength(node:Object=null, parent:Object = null):void
+     {
+        currentLength = calculateLength();
+     }
+
+    /**
+     * @private
+     *  Fill the node array with the node and all of its visible children
+     *  update the parentMap as you go.
+     */
+    private function getVisibleNodes(node:Object, parent:Object, nodeArray:Array):void
+    {
+        var childNodes:ICollectionView;
+        nodeArray.push(node);
+
+        var uid:String = UIDUtil.getUID(node);
+        parentMap[uid] = parent;
+        if (openNodes[uid] != null &&
+            hierarchicalData.canHaveChildren(node) &&
+            hierarchicalData.hasChildren(node))
+        {
+            childNodes = getChildren(node);
+            if (childNodes != null)
+            {
+                var cursor:IViewCursor = childNodes.createCursor();
+                while (!cursor.afterLast)
+                {
+                    getVisibleNodes(cursor.current, node, nodeArray);
+                    try
+                    {
+                        cursor.moveNext();
+                    }
+                    catch (e:ItemPendingError)
+                    {
+                        // Items are pending - so return
+                        return;
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     *  @private
+     *  Factor in the available open children before this location in the model
+     */
+    private function getVisibleLocation(oldLocation:int):int
+    {
+        var newLocation:int = 0;
+        var modelCursor:IViewCursor = treeData.createCursor();
+        for (var i:int = 0; i < oldLocation && !modelCursor.afterLast; i++)
+        {
+            newLocation += calculateLength(modelCursor.current, null) + 1;
+            try
+            {
+                modelCursor.moveNext();
+            }
+            catch (e:ItemPendingError)
+            {
+                // just return the location as the items are pending
+                return newLocation;
+            }
+        }
+        return newLocation;
+    }
+
+    /**
+     * @private
+     * factor in the open children before this location in a sub collection
+     */
+    private function getVisibleLocationInSubCollection(parent:Object, oldLocation:int):int
+    {
+        var newLocation:int = oldLocation;
+        var target:Object = parent;
+        parent = getParentItem(parent);
+        var children:ICollectionView;
+        var cursor:IViewCursor;
+        while (parent != null)
+        {
+            children = childrenMap[parent];
+            cursor = children.createCursor();
+            while (!cursor.afterLast)
+            {
+                if (cursor.current == target)
+                {
+                    newLocation++;
+                    break;
+                }
+                newLocation += calculateLength(cursor.current, parent) + 1;
+                try
+                {
+                    cursor.moveNext();
+                }
+                catch (e:ItemPendingError)
+                {
+                    break;
+                }
+            }
+            target = parent;
+            parent = getParentItem(parent);
+        }
+        cursor = treeData.createCursor();
+        while (!cursor.afterLast)
+        {
+            if (cursor.current == target)
+            {
+                newLocation++;
+                break;
+            }
+            newLocation += calculateLength(cursor.current, parent) + 1;
+            try
+            {
+                cursor.moveNext();
+            }
+            catch (e:ItemPendingError)
+            {
+                break;
+            }
+        }
+        return newLocation;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    public function collectionChangeHandler(event:CollectionEvent):void
+    {
+        var i:int;
+        var n:int;
+        var location:int;
+        var uid:String;
+        var parent:Object;
+        var node:Object;
+        var items:Array;
+
+        var convertedEvent:CollectionEvent;
+
+        if (event is CollectionEvent)
+        {
+            var ce:CollectionEvent = CollectionEvent(event);
+            if (ce.kind == CollectionEventKind.RESET)
+            {
+                // initialize the collection again - its source is modified
+                if (hierarchicalData)
+                    initializeCollection(hierarchicalData.getRoot(), hierarchicalData, openNodes);
+                updateLength();
+                internalRefresh(false);
+                dispatchEvent(event);
+            }
+            else if (ce.kind == CollectionEventKind.ADD)
+            {
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        ce.kind);
+                convertedEvent.location = getVisibleLocation(ce.location);
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i];
+                    if (node is XML)
+						startTrackUpdates(node);
+                    getVisibleNodes(node, null, convertedEvent.items);
+                }
+                currentLength += convertedEvent.items.length;
+                dispatchEvent(convertedEvent);
+            }
+            else if (ce.kind == CollectionEventKind.REMOVE)
+            {
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        ce.kind);
+                convertedEvent.location = getVisibleLocation(ce.location);
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i];
+                    if (node is XML)
+						stopTrackUpdates(node);
+                    getVisibleNodes(node, null, convertedEvent.items);
+                }
+                currentLength -= convertedEvent.items.length;
+                dispatchEvent(convertedEvent);
+
+            }
+            else if (ce.kind == CollectionEventKind.UPDATE)
+            {
+                // so far, nobody cares about the details so just
+                // send it
+                dispatchEvent(event);
+            }
+            else if (ce.kind == CollectionEventKind.REPLACE)
+            {
+                // someday handle case where node is marked as open
+                // before it becomes the replacement.
+                // for now, just pass on the data and remove
+                // old visible rows
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        CollectionEventKind.REMOVE);
+
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i].oldValue;
+                    if (node is XML)
+						stopTrackUpdates(node);
+                    getVisibleNodes(node, null, convertedEvent.items);
+                }
+
+                // prune the replacements from this list
+                var j:int = 0;
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i].oldValue;
+                    while (convertedEvent.items[j] != node)
+                        j++;
+                    convertedEvent.items.splice(j, 1);
+                }
+                if (convertedEvent.items.length)
+                {
+                    currentLength -= convertedEvent.items.length;
+                    // nobody cares about location yet.
+                    dispatchEvent(convertedEvent);
+                }
+                dispatchEvent(event);
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    public function nestedCollectionChangeHandler(event:CollectionEvent):void
+    {
+        var i:int;
+        var n:int;
+        var location:int;
+        var uid:String;
+        var parent:Object;
+        var node:Object;
+        var items:Array;
+        var convertedEvent:CollectionEvent;
+
+        if (event is CollectionEvent)
+        {
+            var ce:CollectionEvent = CollectionEvent(event);
+            if (ce.kind == CollectionEventKind.mx_internal::EXPAND)
+            {
+                event.stopImmediatePropagation();
+            }
+            else if (ce.kind == CollectionEventKind.ADD)
+            {
+                // optimize someday.  We do a full tree walk so we can
+                // not only count how many but find the parents of the
+                // new nodes.  A better scheme would be to just
+                // increment by the number of visible nodes, but we
+                // don't have a good way to get the parents.
+                updateLength();
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        ce.kind);
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i];
+                    if (node is XML)
+						startTrackUpdates(node);
+                    parent = getParentItem(node);
+                    if (parent != null)
+                        getVisibleNodes(node, parent, convertedEvent.items);
+                }
+                convertedEvent.location = getVisibleLocationInSubCollection(parent, ce.location);
+                dispatchEvent(convertedEvent);
+            }
+            else if (ce.kind == CollectionEventKind.REMOVE)
+            {
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        ce.kind);
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i];
+                    if (node is XML)
+						stopTrackUpdates(node);
+                    parent = getParentItem(node);
+                    if (parent != null)
+                        getVisibleNodes(node, parent, convertedEvent.items);
+                }
+                convertedEvent.location = getVisibleLocationInSubCollection(parent, ce.location);
+                currentLength -= convertedEvent.items.length;
+                dispatchEvent(convertedEvent);
+            }
+            else if (ce.kind == CollectionEventKind.UPDATE)
+            {
+                // so far, nobody cares about the details so just
+                // send it
+                dispatchEvent(event);
+            }
+            else if (ce.kind == CollectionEventKind.REPLACE)
+            {
+                // someday handle case where node is marked as open
+                // before it becomes the replacement.
+                // for now, just pass on the data and remove
+                // old visible rows
+                n = ce.items.length;
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        CollectionEventKind.REMOVE);
+
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i].oldValue;
+                    parent = getParentItem(node);
+
+                    if (parent != null)
+					{
+                        getVisibleNodes(node, parent, convertedEvent.items);
+						// update the parent of the new item only
+						// if the parent node is opened
+						if (_openNodes[UIDUtil.getUID(parent)] != null)
+						{
+							var newNode:Object = ce.items[i].newValue;
+							uid = UIDUtil.getUID(newNode);
+							parentMap[uid] = parent;
+
+							// delete the parent map for the old node
+							delete parentMap[UIDUtil.getUID(node)];
+						}
+					}
+                }
+
+                // prune the replacements from this list
+                var j:int = 0;
+                for (i = 0; i < n; i++)
+                {
+                    node = ce.items[i].oldValue;
+					if (node is XML)
+						stopTrackUpdates(node);
+                    while (convertedEvent.items[j] != node)
+                        j++;
+                    convertedEvent.items.splice(j, 1);
+                }
+                if (convertedEvent.items.length)
+                {
+                    currentLength -= convertedEvent.items.length;
+                    // nobody cares about location yet.
+                    dispatchEvent(convertedEvent);
+                }
+                dispatchEvent(event);
+            }
+            else if (ce.kind == CollectionEventKind.RESET)
+            {
+                // removeAll() sends a RESET.
+                // when we get a reset we don't know what went away
+                // and we don't know how many things went away, so
+                // we just fake a refresh as if there was a filter
+                // applied that filtered out whatever went away
+                updateLength();
+                convertedEvent = new CollectionEvent(
+                                        CollectionEvent.COLLECTION_CHANGE,
+                                        false,
+                                        true,
+                                        CollectionEventKind.REFRESH);
+                dispatchEvent(convertedEvent);
+            }
+        }
+    }
+
+    /**
+     * Called whenever an XML object contained in our list is updated
+     * in some way.  The initial implementation stab is very lenient,
+     * any changeType will cause an update no matter how much further down
+     * in a hierarchy.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function xmlNotification(currentTarget:Object,
+                                        type:String,
+                                        target:Object,
+                                        value:Object,
+                                        detail:Object):void
+    {
+        var prop:String;
+        var oldValue:Object;
+        var newValue:Object;
+		var children:XMLListCollection;
+		var location:int;
+        var event:CollectionEvent;
+		var list:XMLListAdapter;
+
+		// trace("currentTarget", currentTarget.toXMLString());
+		// trace("target", target.toXMLString());
+		// trace("value", value.toXMLString());
+		// trace("type", type);
+
+		if (currentTarget === target)
+        {
+	        switch(type)
+	        {
+	            case "nodeAdded":
+	            {
+					for (var q:* in childrenMap)
+					{
+						if (q === currentTarget)
+						{
+							list = childrenMap[q].list as XMLListAdapter;
+							if (list && !list.busy())
+							{
+								if (childrenMap[q] === treeData)
+								{
+									children = treeData as XMLListCollection;
+									if (parentNode != null)
+									{
+										children.mx_internal::dispatchResetEvent = false;
+										children.source = parentNode.*;
+										children.refresh();
+									}
+								}
+								else
+								{
+									// this should refresh the collection
+									children = getChildren(q) as XMLListCollection;
+								}
+								if (children)
+								{
+									// now we fake an event on behalf of the
+									// child collection
+									location = value.childIndex();
+									event = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+									event.kind = CollectionEventKind.ADD;
+									event.location = location;
+									event.items = [ value ];
+									children.dispatchEvent(event);
+								}
+							}
+							break;
+						}
+					}
+	                break;
+	            }
+
+				/* needed?
+	            case "nodeChanged":
+	            {
+	                prop = value.localName();
+	                oldValue = detail;
+	                newValue = value;
+	                break;
+	            }
+				*/
+
+	            case "nodeRemoved":
+	            {
+					// lookup doesn't work, must scan instead
+					for (var p:* in childrenMap)
+					{
+						if (p === currentTarget)
+						{
+							children = childrenMap[p];
+							list = children.list as XMLListAdapter;
+							if (list && !list.busy())
+							{
+								var xmllist:XMLList = children.source as XMLList;
+
+								if (childrenMap[p] === treeData)
+								{
+									children = treeData as XMLListCollection;
+									if (parentNode)
+									{
+										children.mx_internal::dispatchResetEvent = false;
+										children.source = parentNode.*;
+										children.refresh();
+									}
+								}
+								else
+								{
+									var oldChildren:XMLListCollection = children;
+									// this should refresh the collection
+									children = getChildren(p) as XMLListCollection;
+									if (!children)
+									{
+										// last item got removed so there's no child collection
+    									oldChildren.addEventListener(CollectionEvent.COLLECTION_CHANGE,
+    																  nestedCollectionChangeHandler, false, 0, true);
+
+										event = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+										event.kind = CollectionEventKind.REMOVE;
+										event.location = 0;
+										event.items = [ value ];
+										oldChildren.dispatchEvent(event);
+    									oldChildren.removeEventListener(CollectionEvent.COLLECTION_CHANGE,
+    																  nestedCollectionChangeHandler);
+
+									}
+								}
+								if (children)
+								{
+									var n:int = xmllist.length();
+									for (var i:int = 0; i < n; i++)
+									{
+										if (xmllist[i] === value)
+										{
+											event = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+											event.kind = CollectionEventKind.REMOVE;
+											event.location = location;
+											event.items = [ value ];
+											children.dispatchEvent(event);
+											break;
+										}
+									}
+								}
+							}
+							break;
+						}
+					}
+	                break;
+	            }
+
+	            default:
+				{
+	                break;
+				}
+	        }
+        }
+    }
+
+    /**
+     *  This is called by addItemAt and when the source is initially
+     *  assigned.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    private function startTrackUpdates(item:Object):void
+    {
+        XMLNotifier.getInstance().watchXML(item, this);
+    }
+
+    /**
+     *  This is called by removeItemAt, removeAll, and before a new
+     *  source is assigned.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    private function stopTrackUpdates(item:Object):void
+    {
+        XMLNotifier.getInstance().unwatchXML(item, this);
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 7743
Author:   clucier@adobe.com
Date:     2009-06-11T13:53:10.203664Z

Log Message:
-----------
Moving away from using namespace qualifiers in most cases in the SDK.  We've run into a few cases now where the use of qualifiers in code that is called excessively can slow things down.
Bugs: SDK-21337
Reviewer: Ryan, Paul
QE Notes: None
Tests: Ran several random Mustella test groups, checkintests.

Modified Paths:
--------------
106 paths were modified

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

--- frameworks/projects/framework/src/mx/containers/utilityClasses/ConstraintColumn.as
+++ frameworks/projects/framework/src/mx/containers/utilityClasses/ConstraintColumn.as
@@ -262,7 +262,7 @@
     		{
     			_width = value;
                 if (!isNaN(_width))
-                    mx_internal::contentSize = false;
+                    contentSize = false;
     			if (container)
     			{
     				container.invalidateSize();
@@ -361,7 +361,7 @@

         _percentWidth = value;
         if (!isNaN(_percentWidth))
-            mx_internal::contentSize = false;
+            contentSize = false;

         if (container)
         {
@@ -424,7 +424,7 @@
     {
 		this.id = id;
 		if (!this.width && !this.percentWidth)
-			mx_internal::contentSize = true;
+			contentSize = true;
     }

 	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 21680
Author:   jszeto@adobe.com
Date:     2011-07-21T21:56:22.533455Z

Log Message:
-----------
Item Snapping, SpinnerList and DateSpinner Initial checkin

Merging in changes from sandbox development branch

SpinnerList and DateSpinner are in usable states, but there is still unimplemented functionality.

QE notes: none
Doc notes: none
Bugs: none
Reviewer: Tom Kraikit, Eric Day, Jason Szeto
Tests run: checkintests, full cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateAndTimeRangeList.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.settings/org.eclipse.core.resources.prefs</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListScrollerSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/ScrollSnappingMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/CalendarDate.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSelectorDisplayMode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.settings</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/DateSpinnerTest-app.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/effects/ThrowEffect.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerBackground.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/views</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.flexProperties</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/libs</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.actionScriptProperties</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/bundles/en_US/components.properties</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollHelper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/TabbedViewNavigatorButtonBarFirstButton_down.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/DateSpinnerTest.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/blackberry-tablet.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/src/views/DateSpinnerTestHomeView.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="dir" action="M">/private/flex/sdk/branches/4.y</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListItemRenderer.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/.settings</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerSelectionIndicator.fxg</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/development/eclipse/flex/DateSpinnerTest/.project</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile320/assets/SpinnerListContainerShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile240/assets/SpinnerListContainerShadow.fxg</path>
<path kind="file" action="A">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile160/assets/SpinnerListContainerShadow.fxg</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/SpinnerListContainerSkin.as
@@ -0,0 +1,319 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2011 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+package spark.skins.mobile
+{
+import flash.display.Graphics;
+import flash.display.InteractiveObject;
+import flash.display.Sprite;
+
+import mx.core.DPIClassification;
+
+import spark.components.Group;
+import spark.components.HGroup;
+import spark.components.SpinnerListContainer;
+import spark.layouts.HorizontalLayout;
+import spark.skins.mobile.supportClasses.MobileSkin;
+import spark.skins.mobile160.assets.SpinnerListContainerBackground;
+import spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
+import spark.skins.mobile160.assets.SpinnerListContainerShadow;
+import spark.skins.mobile240.assets.SpinnerListContainerBackground;
+import spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
+import spark.skins.mobile240.assets.SpinnerListContainerShadow;
+import spark.skins.mobile320.assets.SpinnerListContainerBackground;
+import spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
+import spark.skins.mobile320.assets.SpinnerListContainerShadow;
+
+/**
+ *  ActionScript-based skin for the SpinnerListContainer in mobile applications.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3
+ *  @productversion Flex 4.5.2
+ */
+public class SpinnerListContainerSkin extends MobileSkin
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+	/**
+	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 *
+	 */
+	public function SpinnerListContainerSkin()
+	{
+		super();
+
+		switch (applicationDPI)
+		{
+			case DPIClassification.DPI_320:
+			{
+				borderClass = spark.skins.mobile320.assets.SpinnerListContainerBackground;
+				selectionIndicatorClass = spark.skins.mobile320.assets.SpinnerListContainerSelectionIndicator;
+				shadowClass = spark.skins.mobile320.assets.SpinnerListContainerShadow;
+
+				cornerRadius = 10;
+				borderThickness = 2;
+				selectionIndicatorHeight = 80;
+				break;
+			}
+			case DPIClassification.DPI_240:
+			{
+				borderClass = spark.skins.mobile240.assets.SpinnerListContainerBackground;
+				selectionIndicatorClass = spark.skins.mobile240.assets.SpinnerListContainerSelectionIndicator;
+				shadowClass = spark.skins.mobile240.assets.SpinnerListContainerShadow;
+
+				cornerRadius = 8;
+				borderThickness = 1;
+				selectionIndicatorHeight = 60;
+				break;
+			}
+			default: // default DPI_160
+			{
+				borderClass = spark.skins.mobile160.assets.SpinnerListContainerBackground;
+				selectionIndicatorClass = spark.skins.mobile160.assets.SpinnerListContainerSelectionIndicator;
+				shadowClass = spark.skins.mobile160.assets.SpinnerListContainerShadow;
+
+				cornerRadius = 5;
+				borderThickness = 1;
+				selectionIndicatorHeight = 40;
+
+				break;
+			}
+		}
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Pixel thickness of the border
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var borderThickness:Number;
+
+	/**
+	 *  Radius of the border corners
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var cornerRadius:Number;
+
+	/**
+	 *  Height of the selection indicator
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var selectionIndicatorHeight:Number;
+
+	/**
+	 *  Class for the border part
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var borderClass:Class;
+
+	/**
+	 *  Class for the selection indicator part
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var selectionIndicatorClass:Class;
+
+	/**
+	 *  Class for the shadow part
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var shadowClass:Class;
+
+	/**
+	 *  Border part which includes the background
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var border:InteractiveObject;
+
+	/**
+	 *  Selection indicator part
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var selectionIndicator:InteractiveObject;
+
+	/**
+	 *  Shadow part
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var shadow:InteractiveObject;
+
+	/**
+	 *  Mask for the content group
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	protected var contentGroupMask:Sprite;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Skin parts
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  An optional skin part that defines the Group where the content
+	 *  children get pushed into and laid out.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion AIR 3
+	 *  @productversion Flex 4.5.2
+	 */
+	public var contentGroup:Group;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+	/**
+	 *  @copy spark.skins.spark.ApplicationSkin#hostComponent
+	 */
+	public var hostComponent:SpinnerListContainer;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden Methods
+	//
+	//--------------------------------------------------------------------------
+	override protected function createChildren():void
+	{
+		super.createChildren();
+
+		if (!border)
+		{
+			// Border and background
+			border = new borderClass();
+			border.mouseEnabled = false;
+			addChild(border);
+		}
+
+		if (!contentGroup)
+		{
+			// Contains the child elements
+			contentGroup = new Group();
+			var hLayout:HorizontalLayout = new HorizontalLayout();
+			hLayout.gap = 0;
+			contentGroup.layout = hLayout;
+			contentGroup.id = "contentGroup";
+			addChild(contentGroup);
+		}
+
+		if (!shadow)
+		{
+			// Shadowing sits on top of the content
+			shadow = new shadowClass();
+			shadow.mouseEnabled = false;
+			addChild(shadow);
+		}
+
+		if (!selectionIndicator)
+		{
+			// Selection indicator is on top
+			selectionIndicator = new selectionIndicatorClass();
+			selectionIndicator.mouseEnabled = false;
+			addChild(selectionIndicator);
+		}
+
+		if (!contentGroupMask)
+		{
+			// Create a mask for the content
+			contentGroupMask = new Sprite();
+			addChild(contentGroupMask);
+		}
+	}
+
+	override protected function measure():void
+	{
+		super.measure();
+
+		var contentW:Number = contentGroup.getPreferredBoundsWidth();
+		var contentH:Number = contentGroup.getPreferredBoundsHeight();
+
+		// TODO (jszeto) Figure out min size behavior
+		measuredWidth = measuredMinWidth = contentW + borderThickness * 2;
+		measuredHeight = measuredMinHeight = contentH + borderThickness * 2;
+	}
+
+	override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+	{
+		super.layoutContents(unscaledWidth, unscaledHeight);
+
+		var contentW:Number = contentGroup.getPreferredBoundsWidth();
+		var contentH:Number = contentGroup.getPreferredBoundsHeight();
+
+		setElementPosition(contentGroup, borderThickness, borderThickness);
+		setElementSize(contentGroup, unscaledWidth - borderThickness * 2, unscaledHeight - borderThickness * 2);
+
+		// Inset by the borderThickness horizontally because the selectionIndicator starts at 0
+		setElementPosition(border, borderThickness, 0);
+		setElementSize(border, unscaledWidth - borderThickness * 2, unscaledHeight);
+
+		setElementPosition(shadow, borderThickness * 2, borderThickness);
+		setElementSize(shadow, unscaledWidth - borderThickness * 4, unscaledHeight - borderThickness * 2);
+
+		setElementPosition(selectionIndicator, 0, Math.floor((unscaledHeight - selectionIndicatorHeight) / 2));
+		setElementSize(selectionIndicator, unscaledWidth, selectionIndicatorHeight);
+
+		// The SpinnerLists contain a left and right border. We don't want to show the leftmost
+		// SpinnerLists's left border nor the rightmost one's right border.
+		// We inset the mask on the left and right sides to accomplish this.
+		var g:Graphics = contentGroupMask.graphics;
+		g.beginFill(0x00FF00);
+		g.drawRoundRect(borderThickness * 2, borderThickness,
+						unscaledWidth - borderThickness * 4,
+						unscaledHeight - borderThickness * 2,
+						cornerRadius, cornerRadius);
+		g.endFill();
+
+		contentGroup.mask = contentGroupMask;
+	}
+}
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Added generation of sound event

Added generation of sound event

--- DroneAnarchy/Resources/Scripts/GameObjects.as
+++ DroneAnarchy/Resources/Scripts/GameObjects.as
@@ -376,6 +376,10 @@
 	{
 		SpawnBullet(true);
 		SpawnBullet(false);
+		VariantMap eventData;
+		eventData["SoundNode"] = refNode_;
+		eventData["SoundName"] = "Resources/Sounds/boom1.wav";
+		SendEvent("SoundGenerated", eventData);
 	}

 	OrdinaryWeapon(Node@ refNode)


hls.nextLevel : implement it against for alt audio playlists for alt audio, only flush tags coming from main fragment loader, keep tags coming from alt audio fragment loader

--- src/org/mangui/hls/stream/StreamBuffer.as
+++ src/org/mangui/hls/stream/StreamBuffer.as
@@ -368,36 +368,50 @@
         /** Return the quality level of the next played fragment **/
         public function get nextLevel() : int {
             if(_videoIdx < _videoTags.length) {
-                return _audioTags[_audioIdx].fragLevel;
+                return _videoTags[_videoIdx].fragLevel;
             } else {
                 return _hls.currentLevel;
             }
         };
+
+        // remove tags coming from main fragment loader, only keep tags coming from alt audio frag loader
+        private function filterMainFragmentTags(tags : Vector.<FLVData>, startIndex : int) : void {
+            for (var i : int = startIndex; i < tags.length; i++) {
+                if(tags[i].loaderType == HLSLoaderTypes.FRAGMENT_MAIN) {
+                    // splice FLV tag from main fragment loader
+                    tags.splice(i,1);
+                }
+            }
+        }

         /*  set quality level for next loaded fragment (-1 for automatic level selection) */
         public function set nextLevel(level : int) : void {
             /* remove tags not injected into NetStream.
-                as tags are injected on fragment boundary, we know that flushing this way will work
+                as tags are injected on fragment boundary, tags not injected in NetStream corresponds
+                with next fragment tags
             */
-            _metaTags.splice(_metaIdx, _metaTags.length-_metaIdx);
-            _headerTags.splice(_headerIdx, _headerTags.length-_headerIdx);
-            _audioTags.splice(_audioIdx, _audioTags.length-_audioIdx);
+            // flush all video tags not injected into NetStream
             _videoTags.splice(_videoIdx, _videoTags.length-_videoIdx);
+
+            // if we are not using alt audio, we can flush all other "not buffered" tags as well
+            if(_useAltAudio == false) {
+                _audioTags.splice(_audioIdx, _audioTags.length-_audioIdx);
+                _headerTags.splice(_headerIdx, _headerTags.length-_headerIdx);
+                _metaTags.splice(_metaIdx, _metaTags.length-_metaIdx);
+            } else {
+                // we keep audio tags, no need to flush them
+                // keep alt audio header tags located after _headerIdx
+                filterMainFragmentTags(_headerTags,_headerIdx);
+                // keep alt audio metadata located after _metaIdx
+                filterMainFragmentTags(_metaTags,_metaIdx);
+            }

             // determine position within next fragment (add 1s to be sure that we are inside next frag)
             var pos : Number = position + (_hls.stream as HLSNetStream).netStreamBufferLength + 1;
             // stop any load in progress ...
             _fragmentLoader.stop();
-            _altaudiofragmentLoader.stop();
             // seek position is out of buffer : load from fragment
             _fragmentLoader.seek(pos);
-            // check if we need to use alt audio fragment loader
-            if (_useAltAudio) {
-                CONFIG::LOGGING {
-                    Log.info("seek : need to load alt audio track");
-                }
-                _altaudiofragmentLoader.seek(pos);
-            }
         };

         /**  StreamBuffer Timer, responsible of


fixed bug where DefaultDataDescriptor was overwriting dynamic values in
WeaveMenuItem.

Change-Id: I83f1bef2172a04d634101aea37274d860af5e15d

--- WeaveUISpark/src/weave/menus/WeaveMenuItem.as
+++ WeaveUISpark/src/weave/menus/WeaveMenuItem.as
@@ -15,6 +15,7 @@

 package weave.menus
 {
+	import weave.api.core.ILinkableVariable;
 	import weave.core.LinkableBoolean;
 	import weave.primitives.WeaveTreeItem;

@@ -124,6 +125,18 @@
 		}
 		public function set toggled(value:*):void
 		{
+			// Here we check if _toggled is a special value before setting it because
+			// we don't want DefaultDataDescriptor.setToggled() to overwrite it.
+			if (value is Boolean)
+			{
+				if (_toggled is ILinkableVariable)
+				{
+					(_toggled as ILinkableVariable).setSessionState(value);
+					return;
+				}
+				if (_toggled is Function)
+					return;
+			}
 			_toggled = value;
 		}


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

--- frameworks/projects/charts/src/mx/charts/chartClasses/IAxisRenderer.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/IAxisRenderer.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.chartClasses
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/charts/src/mx/charts/chartClasses/StackedSeries.as
+++ frameworks/projects/charts/src/mx/charts/chartClasses/StackedSeries.as
@@ -1,9 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
-//  All Rights Reserved. The following is Source Code and is subject to all
-//  restrictions on such code as contained in the End User License Agreement
-//  accompanying this product.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////