Transferred from the Adobe Open Source Subversion Repository

Revision: 10633
Author:   dloverin@adobe.com
Date:     2009-09-28T13:24:30.559033Z

Log Message:
-----------
Use styleManager instance instead of StyleManager singleton (framework and compiler generated code)

Modified compiler generated style code for the FlexInit class. The style related changes are only available with the -keep option. AST generation is coming later.

Only the framework project is changed here. The other projects are will be changed soon.

QE notes: None.
Doc notes: None.
Bugs:
Reviewer: Alex and Paul
Tests run: checkintests, all Mustella tests(no new failures)
Is noteworthy for integration: no.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonBarButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.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/framework/src/mx/skins/halo/ButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressIndeterminateSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserMonthArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderThumbSkin.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/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.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/framework/src/mx/skins/halo/ScrollThumbSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleModule.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager2.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/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.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/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TitleBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperDownSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PopUpButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/ProgrammaticSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TabSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/textClasses/TextRange.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/CheckBoxIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperUpSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/RadioButtonIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ComboBoxArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.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/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/MenuBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressBarSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/BusyCursor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/Request.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DataGridHeaderBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SetStyleActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm</path>

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

--- frameworks/projects/mx/src/mx/skins/halo/ButtonSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/ButtonSkin.as
@@ -140,7 +140,7 @@
 		var cornerRadius:Number = getStyle("cornerRadius");
 		var fillAlphas:Array = getStyle("fillAlphas");
 		var fillColors:Array = getStyle("fillColors");
-		StyleManager.getColorNames(fillColors);
+        styleManager.getColorNames(fillColors);
 		var highlightAlphas:Array = getStyle("highlightAlphas");
 		var themeColor:uint = getStyle("themeColor");


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

--- frameworks/projects/mx/src/mx/skins/halo/SwatchSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/SwatchSkin.as
@@ -80,7 +80,7 @@
     {
 		super.updateDisplayList(w, h);

-		mx_internal::updateSkin(mx_internal::color);
+		updateSkin(color);
     }

     //--------------------------------------------------------------------------
@@ -97,7 +97,7 @@
         if (name == "swatchGrid")
         {
             graphics.clear();
-            drawGrid(dp, mx_internal::colorField);
+            drawGrid(dp, colorField);
         }
     }

@@ -216,7 +216,7 @@

 			var c:Number = typeof(dp.getItemAt(n)) != "object" ?
 						   Number(dp.getItemAt(n)) :
-						   Number((dp.getItemAt(n))[mx_internal::colorField]);
+						   Number((dp.getItemAt(n))[colorField]);

             // Draw rectangle...
             drawSwatch(swatchX, swatchY, swatchWidth, swatchHeight, c);


Transferred from the Adobe Open Source Subversion Repository

Revision: 784
Author:   shodgson@adobe.com
Date:     2008-03-12T06:03:27.486454Z

Log Message:
-----------
Merge revision 755 from branches/3.0.x to trunk.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/AbstractProducer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/CommandMessage.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/rpc/src/mx/messaging/AbstractProducer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as</path>

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

--- frameworks/projects/rpc/src/mx/messaging/ChannelSet.as
+++ frameworks/projects/rpc/src/mx/messaging/ChannelSet.as
@@ -811,12 +811,25 @@
             var ps:PendingSend = PendingSend(_pendingSends.shift());
             delete _pendingMessages[ps.message];

-            var msg:CommandMessage = ps.message as CommandMessage;
-            if ((msg != null) && !ps.agent.configRequested && ps.agent.needsConfig &&
-                (msg.operation == CommandMessage.CLIENT_PING_OPERATION))
-            {
-                msg.headers[CommandMessage.NEEDS_CONFIG_HEADER] = true;
-                ps.agent.configRequested = true;
+            var command:CommandMessage = ps.message as CommandMessage;
+            if (command != null)
+            {
+                // Filter out any commands to trigger connection establishment, and ack them locally.
+                if (command.operation == CommandMessage.TRIGGER_CONNECT_OPERATION)
+                {
+                    var ack:AcknowledgeMessage = new AcknowledgeMessage();
+                    ack.clientId = ps.agent.clientId;
+                    ack.correlationId = command.messageId;
+                    ps.agent.acknowledge(ack, command);
+                    continue;
+                }
+
+                if (!ps.agent.configRequested && ps.agent.needsConfig &&
+                    (command.operation == CommandMessage.CLIENT_PING_OPERATION))
+                {
+                    command.headers[CommandMessage.NEEDS_CONFIG_HEADER] = true;
+                    ps.agent.configRequested = true;
+                }
             }

             send(ps.agent, ps.message);


Transferred from the Adobe Open Source Subversion Repository

Revision: 17841
Author:   hmuller@adobe.com
Date:     2010-09-24T15:36:59.172298Z

Log Message:
-----------
The ColumnHeaderBar classes have been substantially revised simplified and some of the horizontal scrolling flashing has been eliminated.  I've temporarily removed the column header bar event handling code since we weren't using it.   It will be restored when the column resizing feature is added.

The new versions of ColumnHeaderBar and ColumnHeaderBarLayout only depend on Grid (not GridDimensions or GridLayout).

QE notes: Failing mustella tests (bitmap and geometry changes) have been excluded
Doc notes:
Bugs: SDK-27967
Reviewer: Kevin
Tests run: checkin, mustella cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/accessibility/DataGridAccImpl.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridHeaderRendererSkin.mxml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultGridHeaderRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowNode.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ColumnHeaderBarLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/IGridRowBackground.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ColumnHeaderBar.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/DefaultColumnHeaderRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridColumn.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DataGridSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridRowList.as</path>

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -239,7 +239,7 @@

     public var backgroundLayer:GridLayer;
     public var selectionLayer:GridLayer;
-    public var rendererLayer:GridLayer
+    public var rendererLayer:GridLayer;
     public var overlayLayer:GridLayer;

@@ -1396,10 +1396,10 @@
      *
      *
If variableRowHeight is true,
      *  the default, the value of this property is used as the estimated
-     *  height for rows that haven’t been scrolled into view yet, rather
+     *  height for rows that haven't been scrolled into view yet, rather
      *  than the preferred height of renderers configured with the typicalItem.
      *  Similarly, when the Grid pads its display with empty rows, this property
-     *  specifies the empty rows’ height.

+     *  specifies the empty rows' height.

      *
      *
If variableRowHeight is false,
      *  the default value of this property is the maximum preferred height
@@ -2876,6 +2876,28 @@
     {
         return gridLayout.getColumnIndexAt(x, y);
     }
+
+    /**
+     *  Return the width of the specified column.  If the cell's entire bounds
+     *  aren't needed, this method is more efficient than getColumnBounds().width.
+     *
+     *
If the specified column's width property isn't defined, then the returned value
+     *  may only be an approximation.  The actual column width is only computed after the column
+     *  has been scrolled into view.

+     *
+     *  @param columnIndex The 0-based index of the column.
+     *  @return The width of the specified column.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function getColumnWidth(columnIndex:int):Number
+    {
+        const column:GridColumn = getGridColumn(columnIndex);
+        return (column && !isNaN(column.width)) ? column.width : gridDimensions.getColumnWidth(columnIndex);
+    }

     /**
      *  @copy spark.components.supportClasses.GridLayout#getCellAt()
@@ -2902,6 +2924,50 @@
     {
         return gridLayout.getCellsAt(x, y, w, h);
     }
+
+    /**
+     *  Return the X coordinate of the specified cell's origin.  If the cell's entire bounds
+     *  aren't needed, this method is more efficient than getCellBounds().x.
+     *
+     *
If all of the columns for the the specfied row and all of the rows preceeding
+     *  it have not yet been scrolled into view, the returned value may only be an approximation,
+     *  based on all of the columns' typicalItems.

+     *
+     *  @param rowIndex The 0-based index of the row.
+     *  @param columnIndex The 0-based index of the column.
+     *  @return The x coordindate of the specified cell's origin.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function getCellX(rowIndex:int, columnIndex:int):Number
+    {
+        return gridDimensions.getCellX(rowIndex, columnIndex);
+    }
+
+    /**
+     *  Return the Y coordinate of the specified cell's origin.  If the cell's entire bounds
+     *  aren't needed, this method is more efficient than getCellBounds().y.
+     *
+     *
If all of the columns for the the specfied row and all of the rows preceeding
+     *  it have not yet been scrolled into view, the returned value may only be an approximation,
+     *  based on all of the columns' typicalItems.

+     *
+     *  @param rowIndex The 0-based index of the row.
+     *  @param columnIndex The 0-based index of the column.
+     *  @return The y coordindate of the specified cell's origin.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.0
+     *  @productversion Flex 4.5
+     */
+    public function getCellY(rowIndex:int, columnIndex:int):Number
+    {
+        return gridDimensions.getCellY(rowIndex, columnIndex);
+    }

     /**
@@ -3057,7 +3123,7 @@
                 caretColumnIndex =  _columns.length - 1;
             dispatchCaretChangeEvent();
             caretChanged = false;
-        }
+    }
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 19358
Author:   cframpto@adobe.com
Date:     2010-12-14T15:35:50.334373Z

Log Message:
-----------
Fix Grid.invalidateCell() so it works correctly when rowIndex = -1.

QE notes:
Doc notes:
Bugs: SDK-28867
Reviewer:  Hans
Tests run: cyclone
Is noteworthy for integration:

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

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -3605,13 +3605,31 @@
      */
     public function invalidateCell(rowIndex:int, columnIndex:int):void
     {
-        if (!dataProvider || (rowIndex < 0) || (rowIndex >= dataProvider.length))
-            return;
-
+        if (!dataProvider || rowIndex >= dataProvider.length)
+			return;
+
+		if (!isCellVisible(rowIndex, columnIndex))
+			return;
+
         // TODO (hmuller) this is a provisional implementation: invalidate the entire row
+
         const column:GridColumn = getGridColumn(columnIndex);
         const dataField:String = (column) ? column.dataField : null;
-        dataProvider.itemUpdated(dataProvider.getItemAt(rowIndex), dataField);
+
+		if (rowIndex >= 0)
+		{
+			// invalidate the cell or the row by invalidating the visible row
+			dataProvider.itemUpdated(dataProvider.getItemAt(rowIndex), dataField);
+		}
+		else
+		{
+			// invaliate the column by invalidating all visible rows
+			const rowIndices:Vector.<int> = getVisibleRowIndices();
+			for each (rowIndex in rowIndices)
+			{
+				dataProvider.itemUpdated(dataProvider.getItemAt(rowIndex), dataField);
+			}
+		}
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 20622
Author:   klin@adobe.com
Date:     2011-03-04T23:55:42.632363Z

Log Message:
-----------
Fix renderer properties not being updated when hover/caretIndicator are null. When the hover/caretIndicator doesn't exist, we weren't invalidating the display list when the hover or caret indices changed even though the renderers may depend on those indices.

QE notes: No
Doc notes: No
Bugs: SDK-29677
Reviewer: Hans
Tests run: cyclone server, checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as

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

--- frameworks/projects/spark/src/spark/components/Grid.as
+++ frameworks/projects/spark/src/spark/components/Grid.as
@@ -530,8 +530,9 @@
         caretChanged = true;
         invalidateProperties();

-        if (caretIndicator)
-            invalidateDisplayListFor("caretIndicator");
+        // Unconditionally invalidate because renderers may depend on
+        // caretColumnIndex even when the caretIndicator doesn't exist.
+        invalidateDisplayListFor("caretIndicator");
         dispatchChangeEvent("caretColumnIndexChanged");
     }

@@ -583,9 +584,10 @@

         caretChanged = true;
         invalidateProperties();
-
-        if (caretIndicator)
-            invalidateDisplayListFor("caretIndicator");
+
+        // Unconditionally invalidate because renderers may depend on
+        // caretRowIndex even when the caretIndicator doesn't exist.
+        invalidateDisplayListFor("caretIndicator");
         dispatchChangeEvent("caretRowIndexChanged");
     }

@@ -674,8 +676,10 @@
             return;

         _hoverColumnIndex = value;
-        if (hoverIndicator)
-            invalidateDisplayListFor("hoverIndicator");
+
+        // Unconditionally invalidate because renderers may depend on
+        // hoverColumnIndex even when the hoverIndicator doesn't exist.
+        invalidateDisplayListFor("hoverIndicator");
         dispatchChangeEvent("hoverColumnIndexChanged");
     }

@@ -722,8 +726,10 @@
             return;

         _hoverRowIndex = value;
-        if (hoverIndicator)
-            invalidateDisplayListFor("hoverIndicator");
+
+        // Unconditionally invalidate because renderers may depend on
+        // hoverRowIndex even when the hoverIndicator doesn't exist.
+        invalidateDisplayListFor("hoverIndicator");
         dispatchChangeEvent("hoverRowIndexChanged");
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3642
Author:   dsubrama@adobe.com
Date:     2008-10-15T01:27:45.477146Z

Log Message:
-----------
Support minimal keyboard navigation in FxList. We now handle selection incrementing and decrementing correctly when navigating via keyboard. Up/Down no-up in a HorizontalLayout FxList and the same for Left/Right in a VerticalLayout FxList.

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -12,11 +12,16 @@
 package mx.components
 {
 import flash.display.DisplayObject;
+import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
+import flash.ui.Keyboard;

 import mx.components.baseClasses.FxListBase;
 import mx.core.ClassFactory;
 import mx.events.ItemExistenceChangedEvent;
+import mx.layout.BasicLayout;
+import mx.layout.HorizontalLayout;
+import mx.layout.VerticalLayout;
 import mx.skins.spark.FxDefaultItemRenderer;

 /**
@@ -57,6 +62,10 @@
     {
         super();
         itemRenderer = new ClassFactory(FxDefaultItemRenderer);
+
+        //Add a keyDown event listener so we can adjust
+        //selection accordingly.
+        addEventListener(KeyboardEvent.KEY_DOWN, list_keyDownHandler);
     }

     //--------------------------------------------------------------------------
@@ -416,6 +425,50 @@

         selectedItem = dataGroup.getRendererItem(DisplayObject(event.currentTarget));
     }
+
+    /**
+     *  @private
+     */
+    private function list_keyDownHandler(event:KeyboardEvent):void
+    {
+    	switch (event.keyCode)
+        {
+            case Keyboard.UP:
+            {
+            	if (layout is VerticalLayout)
+            		if (selectedIndex > 0)
+            			selectedIndex--;
+            	break;
+            }
+            case Keyboard.DOWN:
+            {
+            	if (layout is VerticalLayout)
+            		if (selectedIndex < (dataProvider.length - 1))
+            			selectedIndex++;
+                break;
+            }
+            case Keyboard.LEFT:
+            {
+            	if (layout is HorizontalLayout)
+            		if (selectedIndex > 0)
+            			selectedIndex--;
+            	break;
+            }
+            case Keyboard.RIGHT:
+            {
+            	if (layout is HorizontalLayout)
+            		if (selectedIndex < (dataProvider.length - 1))
+            			selectedIndex++;
+            	break;
+            }
+            default:
+            {
+            	//make sure keyDown handlers set in tag are clled
+                event.stopPropagation();
+            }
+        }
+    }
+
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 13322
Author:   dsubrama@adobe.com
Date:     2010-01-07T05:19:58.842934Z

Log Message:
-----------
Addressing my FIXMEs. A couple were fixed, one was no longer relevant, and the other three were converted to TODOs.

QE notes: No
Doc notes: No
Bugs: N/A
Reviewer: Me - only comment changes, no code changes.
Tests run: Checkintests
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -859,13 +859,14 @@

             for (var i:int = 0; i < count; i++)
             {
-                // FIXME (dsubrama): What exactly should we do if an
-                //invalid item is in the selectedItems vector?
                 var index:int = dataProvider.getItemIndex(value[i]);
                 if (index != -1)
                 {
                     indices.splice(0, 0, index);
                 }
+                // If an invalid item is in the selectedItems vector,
+                // we set selectedItems to an empty vector, which
+                // essentially clears selection.
                 if (index == -1)
                 {
                     indices = new Vector.<int>();
@@ -2238,7 +2239,7 @@
             // commitProperties, the caretIndex will be adjusted to
             // match the selectedIndex;

-            // FIXME (dsubrama): We should revisit the synchronous nature of the
+            // TODO (dsubrama): We should revisit the synchronous nature of the
             // de-careting/re-careting behavior.
             itemShowingCaret(caretIndex, false);
             caretIndexAdjusted = true;
@@ -2426,14 +2427,10 @@
             return;

         // Delegate to the layout to tell us what the next item is we should select or focus into.
-        // FIXME (dsubrama): At some point we should refactor this so we don't depend on layout
+        // TODO (dsubrama): At some point we should refactor this so we don't depend on layout
         // for keyboard handling. If layout doesn't exist, then use some other keyboard handler
         var proposedNewIndex:int = layout.getNavigationDestinationIndex(caretIndex, navigationUnit, arrowKeysWrapFocus);

-        // FIXME (dsubrama): proposedNewIndex depends on CTRL key
-        // move CTRL key logic into single selection
-        // add SPACE logic - add to selection for multi-select or change selection for single-select
-
         // Note that the KeyboardEvent is canceled even if the current selected or in focus index
         // doesn't change because we don't want another component to start handling these
         // events when the index reaches a limit.


updated loader optimizer for strict compiler

--- ApplicationMap/src/main/actionscript/sk/yoz/net/LoaderOptimizer.as
+++ ApplicationMap/src/main/actionscript/sk/yoz/net/LoaderOptimizer.as
@@ -51,8 +51,9 @@

         public function dispose():void
         {
-            for(var loader:Loader in created)
+            for(var key:Object in created)
             {
+                var loader:Loader = key as Loader;
                 release(loader);
                 removeLoaderListeners(loader);
                 loader.unloadAndStop(true);
@@ -78,8 +79,9 @@
         private function create():Loader
         {
             var loader:Loader;
-            for(loader in released)
+            for(var key:Object in released)
             {
+                loader = key as Loader;
                 delete released[loader];
                 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@1262255 13f79535-47bb-0310-9956-ffa450edef68

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

 package mx.skins
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8679
Author:   jimurphy@adobe.com
Date:     2009-07-20T13:23:31.007823Z

Log Message:
-----------
These are Asdoc edit from 3.x rev 8623.  I somehow missed committing these when they were supposed to be committed during my previous merge.

bug: no
qa: no
doc: no
checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/AMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/PollingChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Consumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicProducer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingConnectionHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/HTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/CallResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/HTTPRequestMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicConsumer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MessageResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureStreamingAMFChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ConfigMap.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractInvoker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/Responder.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/StreamingHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/XMLLoadEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/IResponder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Producer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/channels/SecureStreamingHTTPChannel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AsyncToken.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/events/WSDLLoadEvent.as</path>

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

--- frameworks/projects/rpc/src/mx/messaging/Consumer.as
+++ frameworks/projects/rpc/src/mx/messaging/Consumer.as
@@ -82,7 +82,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  Constructs a Consumer.
+     *  Constructor.
      *
      *  @param messageType The alias for the message type processed by the service
      *                     hosting the remote destination the Consumer will subscribe to.


Transferred from the Adobe Open Source Subversion Repository

Revision: 4957
Author:   jimurphy@adobe.com
Date:     2009-02-13T19:44:53.991275Z

Log Message:
-----------
Merge 3.x revisions 4848,4856,4886,4888,4898,4905,4912,4914-4916,4953 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/XMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/BrowserManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/SerializationFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.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/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ToggleButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SchemaMarshaller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>

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

--- frameworks/projects/rpc/src/mx/rpc/xml/XMLEncoder.as
+++ frameworks/projects/rpc/src/mx/rpc/xml/XMLEncoder.as
@@ -20,6 +20,7 @@
 import mx.utils.ObjectProxy;
 import mx.utils.ObjectUtil;
 import mx.collections.IList;
+import flash.system.Capabilities;

 [ExcludeClass]

@@ -33,6 +34,23 @@
     public function XMLEncoder()
     {
         super();
+
+        // Depending on the player type/version, xml characters in strings
+        // need or need not be escaped. AIR 1.5 ('Desktop' version 10) escapes
+        // these characters by default. For all other versions Flex needs to
+        // do it. The version test to determine this behavior is done here, so
+        // that it's not repeated every time xml content is encoded. This is a
+        // fix for bug SDK-18326.
+        if (flash.system.Capabilities.playerType == "Desktop")
+        {
+            var version:String = flash.system.Capabilities.version.split(' ')[1];
+            var majorVersion:Number = Number(version.split(',')[0]);
+            if (majorVersion >= 10)
+            {
+                _escapeXMLChars = false;
+            }
+        }
+
     }

     //--------------------------------------------------------------------------
@@ -1851,7 +1869,10 @@
     private function escapeXML(value:Object):String
     {
         var str:String = value.toString();
-        str = str.replace(/&/g, "&").replace(/</g, "<");
+        if (_escapeXMLChars)
+        {
+            str = str.replace(/&/g, "&").replace(/</g, "<");
+        }
         return str;
     }

@@ -1908,6 +1929,7 @@

     private var _strictNillability:Boolean = false;
     private var _xmlSpecialCharsFilter:Function = escapeXML;
+    private var _escapeXMLChars:Boolean = true;

 }


修改webgl 多边形null时的报错

修改webgl 多边形null时的报错

--- src/flash/__native/GLCanvasRenderingContext2D.as
+++ src/flash/__native/GLCanvasRenderingContext2D.as
@@ -543,7 +543,7 @@
 			if (fillStyleIsImage) {
 				var glcp:GLCanvasPattern = fillStyle as GLCanvasPattern;
 				drawImageInternal(glcp.image, currentPath.getDrawable(this),currentPath.matr,matr,false,colorTransform.tint,currentPath.path.tris.length>0,true);
-			}else if(currentPath){
+			}else if(currentPath&&currentPath.path.polys){
 				drawImageInternal(fillStyle, currentPath.getDrawable(this),currentPath.matr,null,false,colorTransform,false,false);
 			}
 			return null;


Normalize line endings

Normalize line endings

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -1,447 +1,447 @@
-package htmlelements
-{
-	import flash.display.Sprite;
-	import flash.events.*;
-	import flash.net.NetConnection;
-	import flash.net.NetStream;
-	import flash.media.Video;
-	import flash.media.SoundTransform;
-	import flash.utils.Timer;
-
-	import FlashMediaElement;
-	import HtmlMediaEvent;
-
-	public class VideoElement extends Sprite implements IMediaElement
-	{
-		private var _currentUrl:String = "";
-		private var _autoplay:Boolean = true;
-		private var _preload:String = "";
-		private var _isPreloading:Boolean = false;
-
-		private var _connection:NetConnection;
-		private var _stream:NetStream;
-		private var _video:Video;
-		private var _element:FlashMediaElement;
-		private var _soundTransform;
-		private var _oldVolume:Number = 1;
-
-		// event values
-		private var _duration:Number = 0;
-		private var _framerate:Number;
-		private var _isPaused:Boolean = true;
-		private var _isEnded:Boolean = false;
-		private var _volume:Number = 1;
-		private var _isMuted:Boolean = false;
-
-		private var _bytesLoaded:Number = 0;
-		private var _bytesTotal:Number = 0;
-		private var _bufferedTime:Number = 0;
-		private var _bufferEmpty:Boolean = false;
-
-		private var _videoWidth:Number = -1;
-		private var _videoHeight:Number = -1;
-
-		private var _timer:Timer;
-
-		private var _isRTMP:Boolean = false;
-		private var _isConnected:Boolean = false;
-		private var _playWhenConnected:Boolean = false;
-		private var _hasStartedPlaying:Boolean = false;
-
-		private var _parentReference:Object;
-
-		public function setReference(arg:Object):void {
-			_parentReference = arg;
-		}
-
-		public function setSize(width:Number, height:Number):void {
-			_video.width = width;
-			_video.height = height;
-		}
-
-		public function get video():Video {
-			return _video;
-		}
-
-		public function get videoHeight():Number {
-			return _videoHeight;
-		}
-
-		public function get videoWidth():Number {
-			return _videoWidth;
-		}
-
-
-		public function duration():Number {
-			return _duration;
-		}
-
-		public function currentProgress():Number {
-			if(_stream != null) {
-				return Math.round(_stream.bytesLoaded/_stream.bytesTotal*100);
-			} else {
-				return 0;
-			}
-		}
-
-		public function currentTime():Number {
-			if (_stream != null) {
-				return _stream.time;
-			} else {
-				return 0;
-			}
-		}
-
-
-		// (1) load()
-		// calls _connection.connect();
-		// waits for NetConnection.Connect.Success
-		// _stream gets created
-
-
-		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
-		{
-			_element = element;
-			_autoplay = autoplay;
-			_volume = startVolume;
-			_preload = preload;
-
-			_video = new Video();
-			addChild(_video);
-
-			_connection = new NetConnection();
-			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
-			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
-			//_connection.connect(null);
-
-			_timer = new Timer(timerRate);
-			_timer.addEventListener("timer", timerHandler);
-
-		}
-
-		private function timerHandler(e:TimerEvent) {
-
-			_bytesLoaded = _stream.bytesLoaded;
-			_bytesTotal = _stream.bytesTotal;
-
-			if (!_isPaused)
-				sendEvent(HtmlMediaEvent.TIMEUPDATE);
-
-			//trace("bytes", _bytesLoaded, _bytesTotal);
-
-			if (_bytesLoaded < _bytesTotal)
-				sendEvent(HtmlMediaEvent.PROGRESS);
-		}
-
-		// internal events
-		private function netStatusHandler(event:NetStatusEvent):void {
-			trace("netStatus", event.info.code);
-
-			switch (event.info.code) {
-
-				case "NetStream.Buffer.Empty":
-					_bufferEmpty = true;
-					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-				case "NetStream.Buffer.Full":
-					_bytesLoaded = _stream.bytesLoaded;
-					_bytesTotal = _stream.bytesTotal;
-					_bufferEmpty = false;
-
-					sendEvent(HtmlMediaEvent.PROGRESS);
-					break;
-
-				case "NetConnection.Connect.Success":
-					connectStream();
-					break;
-				case "NetStream.Play.StreamNotFound":
-					trace("Unable to locate video");
-					break;
-
-				// STREAM
-				case "NetStream.Play.Start":
-
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.LOADEDDATA);
-					sendEvent(HtmlMediaEvent.CANPLAY);
-
-					if (!_isPreloading) {
-
-						sendEvent(HtmlMediaEvent.PLAY);
-						sendEvent(HtmlMediaEvent.PLAYING);
-
-					}
-
-					_timer.start();
-
-					break;
-
-				case "NetStream.Seek.Notify":
-					sendEvent(HtmlMediaEvent.SEEKED);
-					break;
-
-				case "NetStream.Pause.Notify":
-					_isPaused = true;
-					sendEvent(HtmlMediaEvent.PAUSE);
-					break;
-
-				case "NetStream.Play.Stop":
-					_isEnded = true;
-					_isPaused = false;
-					_timer.stop();
-					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-			}
-		}
-
-
-		private function securityErrorHandler(event:SecurityErrorEvent):void {
-			trace("securityErrorHandler: " + event);
-		}
-
-		private function asyncErrorHandler(event:AsyncErrorEvent):void {
-			// ignore AsyncErrorEvent events.
-		}
-
-
-		private function onMetaDataHandler(info:Object):void {
-			_duration = info.duration;
-			_framerate = info.framerate;
-			_videoWidth = info.width;
-			_videoHeight = info.height;
-
-			// set size?
-
-			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
-
-
-
-			if (_isPreloading) {
-
-				_stream.pause();
-				_isPaused = true;
-				_isPreloading = false;
-
-				sendEvent(HtmlMediaEvent.PROGRESS);
-				sendEvent(HtmlMediaEvent.TIMEUPDATE);
-
-			}
-		}
-
-
-
-
-		// interface members
-		public function setSrc(url:String):void {
-			if (_isConnected && _stream) {
-				// stop and restart
-				_stream.pause();
-			}
-
-			_currentUrl = url;
-			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
-			_isConnected = false;
-			_hasStartedPlaying = false;
-		}
-
-		public function load():void {
-			// disconnect existing stream and connection
-			if (_isConnected && _stream) {
-				_stream.pause();
-				_stream.close();
-				_connection.close();
-			}
-			_isConnected = false;
-			_isPreloading = false;
-
-
-			_isEnded = false;
-			_bufferEmpty = false;
-
-			// start new connection
-			if (_isRTMP) {
-				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
-			} else {
-				_connection.connect(null);
-			}
-
-			// in a few moments the "NetConnection.Connect.Success" event will fire
-			// and call createConnection which finishes the "load" sequence
-			sendEvent(HtmlMediaEvent.LOADSTART);
-		}
-
-
-		private function connectStream():void {
-			trace("connectStream");
-			_stream = new NetStream(_connection);
-
-			// explicitly set the sound since it could have come before the connection was made
-			_soundTransform = new SoundTransform(_volume);
-			_stream.soundTransform = _soundTransform;
-
-			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
-			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
-
-			var customClient:Object = new Object();
-			customClient.onMetaData = onMetaDataHandler;
-			_stream.client = customClient;
-
-			_video.attachNetStream(_stream);
-
-			// start downloading without playing )based on preload and play() hasn't been called)
-			// I wish flash had a load() command to make this less awkward
-			if (_preload != "none" && !_playWhenConnected) {
-				_isPaused = true;
-				//stream.bufferTime = 20;
-				_stream.play(_currentUrl, 0, 0);
-				_stream.pause();
-
-				_isPreloading = true;
-
-				//_stream.pause();
-				//
-				//sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
-			}
-
-			_isConnected = true;
-
-			if (_playWhenConnected && !_hasStartedPlaying) {
-				play();
-				_playWhenConnected = false;
-			}
-
-		}
-
-		public function play():void {
-
-			if (!_hasStartedPlaying && !_isConnected) {
-				_playWhenConnected = true;
-				load();
-				return;
-			}
-
-			if (_hasStartedPlaying) {
-				if (_isPaused) {
-					_stream.resume();
-					_timer.start();
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.PLAY);
-					sendEvent(HtmlMediaEvent.PLAYING);
-				}
-			} else {
-
-				if (_isRTMP) {
-					_stream.play(_currentUrl.split("/").pop());
-				} else {
-					_stream.play(_currentUrl);
-				}
-				_timer.start();
-				_isPaused = false;
-				_hasStartedPlaying = true;
-
-				// don't toss play/playing events here, because we haven't sent a
-				// canplay / loadeddata event yet. that'll be handled in the net
-				// event listener
-			}
-
-		}
-
-		public function pause():void {
-			if (_stream == null)
-				return;
-
-			_stream.pause();
-			_isPaused = true;
-
-			if (_bytesLoaded == _bytesTotal) {
-				_timer.stop();
-			}
-
-			_isPaused = true;
-			sendEvent(HtmlMediaEvent.PAUSE);
-		}
-
-		public function stop():void {
-			if (_stream == null)
-				return;
-
-			_stream.close();
-			_isPaused = false;
-			_timer.stop();
-			sendEvent(HtmlMediaEvent.STOP);
-		}
-
-		public function setCurrentTime(pos:Number):void {
-			if (_stream == null)
-				return;
-
-			sendEvent(HtmlMediaEvent.SEEKING);
-			_stream.seek(pos);
-			sendEvent(HtmlMediaEvent.TIMEUPDATE);
-		}
-
-		public function setVolume(volume:Number):void {
-			if (_stream != null) {
-				_soundTransform = new SoundTransform(volume);
-				_stream.soundTransform = _soundTransform;
-			}
-
-			_volume = volume;
-
-			_isMuted = (_volume == 0);
-
-			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
-		}
-
-		public function getVolume():Number {
-			if(_isMuted) {
-				return 0;
-			} else {
-				return _volume;
-			}
-		}
-
-		public function setMuted(muted:Boolean):void {
-
-			if (_isMuted == muted)
-				return;
-
-			if (muted) {
-				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
-				setVolume(0);
-			} else {
-				setVolume(_oldVolume);
-			}
-
-			_isMuted = muted;
-		}
-
-
-		private function sendEvent(eventName:String) {
-
-			// calculate this to mimic HTML5
-			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
-
-			// build JSON
-			var values:String =
-							"duration:" + _duration +
-							",framerate:" + _framerate +
-							",currentTime:" + (_stream != null ? _stream.time : 0) +
-							",muted:" + _isMuted +
-							",paused:" + _isPaused +
-							",ended:" + _isEnded +
-							",volume:" + _volume +
-							",src:\"" + _currentUrl + "\"" +
-							",bytesTotal:" + _bytesTotal +
-							",bufferedBytes:" + _bytesLoaded +
-							",bufferedTime:" + _bufferedTime +
-							",videoWidth:" + _videoWidth +
-							",videoHeight:" + _videoHeight +
-							"";
-
-			_element.sendEvent(eventName, values);
-		}
-	}
+package htmlelements
+{
+	import flash.display.Sprite;
+	import flash.events.*;
+	import flash.net.NetConnection;
+	import flash.net.NetStream;
+	import flash.media.Video;
+	import flash.media.SoundTransform;
+	import flash.utils.Timer;
+
+	import FlashMediaElement;
+	import HtmlMediaEvent;
+
+	public class VideoElement extends Sprite implements IMediaElement
+	{
+		private var _currentUrl:String = "";
+		private var _autoplay:Boolean = true;
+		private var _preload:String = "";
+		private var _isPreloading:Boolean = false;
+
+		private var _connection:NetConnection;
+		private var _stream:NetStream;
+		private var _video:Video;
+		private var _element:FlashMediaElement;
+		private var _soundTransform;
+		private var _oldVolume:Number = 1;
+
+		// event values
+		private var _duration:Number = 0;
+		private var _framerate:Number;
+		private var _isPaused:Boolean = true;
+		private var _isEnded:Boolean = false;
+		private var _volume:Number = 1;
+		private var _isMuted:Boolean = false;
+
+		private var _bytesLoaded:Number = 0;
+		private var _bytesTotal:Number = 0;
+		private var _bufferedTime:Number = 0;
+		private var _bufferEmpty:Boolean = false;
+
+		private var _videoWidth:Number = -1;
+		private var _videoHeight:Number = -1;
+
+		private var _timer:Timer;
+
+		private var _isRTMP:Boolean = false;
+		private var _isConnected:Boolean = false;
+		private var _playWhenConnected:Boolean = false;
+		private var _hasStartedPlaying:Boolean = false;
+
+		private var _parentReference:Object;
+
+		public function setReference(arg:Object):void {
+			_parentReference = arg;
+		}
+
+		public function setSize(width:Number, height:Number):void {
+			_video.width = width;
+			_video.height = height;
+		}
+
+		public function get video():Video {
+			return _video;
+		}
+
+		public function get videoHeight():Number {
+			return _videoHeight;
+		}
+
+		public function get videoWidth():Number {
+			return _videoWidth;
+		}
+
+
+		public function duration():Number {
+			return _duration;
+		}
+
+		public function currentProgress():Number {
+			if(_stream != null) {
+				return Math.round(_stream.bytesLoaded/_stream.bytesTotal*100);
+			} else {
+				return 0;
+			}
+		}
+
+		public function currentTime():Number {
+			if (_stream != null) {
+				return _stream.time;
+			} else {
+				return 0;
+			}
+		}
+
+
+		// (1) load()
+		// calls _connection.connect();
+		// waits for NetConnection.Connect.Success
+		// _stream gets created
+
+
+		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
+		{
+			_element = element;
+			_autoplay = autoplay;
+			_volume = startVolume;
+			_preload = preload;
+
+			_video = new Video();
+			addChild(_video);
+
+			_connection = new NetConnection();
+			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
+			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+			//_connection.connect(null);
+
+			_timer = new Timer(timerRate);
+			_timer.addEventListener("timer", timerHandler);
+
+		}
+
+		private function timerHandler(e:TimerEvent) {
+
+			_bytesLoaded = _stream.bytesLoaded;
+			_bytesTotal = _stream.bytesTotal;
+
+			if (!_isPaused)
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			//trace("bytes", _bytesLoaded, _bytesTotal);
+
+			if (_bytesLoaded < _bytesTotal)
+				sendEvent(HtmlMediaEvent.PROGRESS);
+		}
+
+		// internal events
+		private function netStatusHandler(event:NetStatusEvent):void {
+			trace("netStatus", event.info.code);
+
+			switch (event.info.code) {
+
+				case "NetStream.Buffer.Empty":
+					_bufferEmpty = true;
+					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+				case "NetStream.Buffer.Full":
+					_bytesLoaded = _stream.bytesLoaded;
+					_bytesTotal = _stream.bytesTotal;
+					_bufferEmpty = false;
+
+					sendEvent(HtmlMediaEvent.PROGRESS);
+					break;
+
+				case "NetConnection.Connect.Success":
+					connectStream();
+					break;
+				case "NetStream.Play.StreamNotFound":
+					trace("Unable to locate video");
+					break;
+
+				// STREAM
+				case "NetStream.Play.Start":
+
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.LOADEDDATA);
+					sendEvent(HtmlMediaEvent.CANPLAY);
+
+					if (!_isPreloading) {
+
+						sendEvent(HtmlMediaEvent.PLAY);
+						sendEvent(HtmlMediaEvent.PLAYING);
+
+					}
+
+					_timer.start();
+
+					break;
+
+				case "NetStream.Seek.Notify":
+					sendEvent(HtmlMediaEvent.SEEKED);
+					break;
+
+				case "NetStream.Pause.Notify":
+					_isPaused = true;
+					sendEvent(HtmlMediaEvent.PAUSE);
+					break;
+
+				case "NetStream.Play.Stop":
+					_isEnded = true;
+					_isPaused = false;
+					_timer.stop();
+					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+			}
+		}
+
+
+		private function securityErrorHandler(event:SecurityErrorEvent):void {
+			trace("securityErrorHandler: " + event);
+		}
+
+		private function asyncErrorHandler(event:AsyncErrorEvent):void {
+			// ignore AsyncErrorEvent events.
+		}
+
+
+		private function onMetaDataHandler(info:Object):void {
+			_duration = info.duration;
+			_framerate = info.framerate;
+			_videoWidth = info.width;
+			_videoHeight = info.height;
+
+			// set size?
+
+			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
+
+
+
+			if (_isPreloading) {
+
+				_stream.pause();
+				_isPaused = true;
+				_isPreloading = false;
+
+				sendEvent(HtmlMediaEvent.PROGRESS);
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			}
+		}
+
+
+
+
+		// interface members
+		public function setSrc(url:String):void {
+			if (_isConnected && _stream) {
+				// stop and restart
+				_stream.pause();
+			}
+
+			_currentUrl = url;
+			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
+			_isConnected = false;
+			_hasStartedPlaying = false;
+		}
+
+		public function load():void {
+			// disconnect existing stream and connection
+			if (_isConnected && _stream) {
+				_stream.pause();
+				_stream.close();
+				_connection.close();
+			}
+			_isConnected = false;
+			_isPreloading = false;
+
+
+			_isEnded = false;
+			_bufferEmpty = false;
+
+			// start new connection
+			if (_isRTMP) {
+				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
+			} else {
+				_connection.connect(null);
+			}
+
+			// in a few moments the "NetConnection.Connect.Success" event will fire
+			// and call createConnection which finishes the "load" sequence
+			sendEvent(HtmlMediaEvent.LOADSTART);
+		}
+
+
+		private function connectStream():void {
+			trace("connectStream");
+			_stream = new NetStream(_connection);
+
+			// explicitly set the sound since it could have come before the connection was made
+			_soundTransform = new SoundTransform(_volume);
+			_stream.soundTransform = _soundTransform;
+
+			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
+			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
+
+			var customClient:Object = new Object();
+			customClient.onMetaData = onMetaDataHandler;
+			_stream.client = customClient;
+
+			_video.attachNetStream(_stream);
+
+			// start downloading without playing )based on preload and play() hasn't been called)
+			// I wish flash had a load() command to make this less awkward
+			if (_preload != "none" && !_playWhenConnected) {
+				_isPaused = true;
+				//stream.bufferTime = 20;
+				_stream.play(_currentUrl, 0, 0);
+				_stream.pause();
+
+				_isPreloading = true;
+
+				//_stream.pause();
+				//
+				//sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
+			}
+
+			_isConnected = true;
+
+			if (_playWhenConnected && !_hasStartedPlaying) {
+				play();
+				_playWhenConnected = false;
+			}
+
+		}
+
+		public function play():void {
+
+			if (!_hasStartedPlaying && !_isConnected) {
+				_playWhenConnected = true;
+				load();
+				return;
+			}
+
+			if (_hasStartedPlaying) {
+				if (_isPaused) {
+					_stream.resume();
+					_timer.start();
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.PLAY);
+					sendEvent(HtmlMediaEvent.PLAYING);
+				}
+			} else {
+
+				if (_isRTMP) {
+					_stream.play(_currentUrl.split("/").pop());
+				} else {
+					_stream.play(_currentUrl);
+				}
+				_timer.start();
+				_isPaused = false;
+				_hasStartedPlaying = true;
+
+				// don't toss play/playing events here, because we haven't sent a
+				// canplay / loadeddata event yet. that'll be handled in the net
+				// event listener
+			}
+
+		}
+
+		public function pause():void {
+			if (_stream == null)
+				return;
+
+			_stream.pause();
+			_isPaused = true;
+
+			if (_bytesLoaded == _bytesTotal) {
+				_timer.stop();
+			}
+
+			_isPaused = true;
+			sendEvent(HtmlMediaEvent.PAUSE);
+		}
+
+		public function stop():void {
+			if (_stream == null)
+				return;
+
+			_stream.close();
+			_isPaused = false;
+			_timer.stop();
+			sendEvent(HtmlMediaEvent.STOP);
+		}
+
+		public function setCurrentTime(pos:Number):void {
+			if (_stream == null)
+				return;
+
+			sendEvent(HtmlMediaEvent.SEEKING);
+			_stream.seek(pos);
+			sendEvent(HtmlMediaEvent.TIMEUPDATE);
+		}
+
+		public function setVolume(volume:Number):void {
+			if (_stream != null) {
+				_soundTransform = new SoundTransform(volume);
+				_stream.soundTransform = _soundTransform;
+			}
+
+			_volume = volume;
+
+			_isMuted = (_volume == 0);
+
+			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
+		}
+
+		public function getVolume():Number {
+			if(_isMuted) {
+				return 0;
+			} else {
+				return _volume;
+			}
+		}
+
+		public function setMuted(muted:Boolean):void {
+
+			if (_isMuted == muted)
+				return;
+
+			if (muted) {
+				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
+				setVolume(0);
+			} else {
+				setVolume(_oldVolume);
+			}
+
+			_isMuted = muted;
+		}
+
+
+		private function sendEvent(eventName:String) {
+
+			// calculate this to mimic HTML5
+			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
+
+			// build JSON
+			var values:String =
+							"duration:" + _duration +
+							",framerate:" + _framerate +
+							",currentTime:" + (_stream != null ? _stream.time : 0) +
+							",muted:" + _isMuted +
+							",paused:" + _isPaused +
+							",ended:" + _isEnded +
+							",volume:" + _volume +
+							",src:\"" + _currentUrl + "\"" +
+							",bytesTotal:" + _bytesTotal +
+							",bufferedBytes:" + _bytesLoaded +
+							",bufferedTime:" + _bufferedTime +
+							",videoWidth:" + _videoWidth +
+							",videoHeight:" + _videoHeight +
+							"";
+
+			_element.sendEvent(eventName, values);
+		}
+	}
 }


No need for the Dictionary, Object is simpler and enough for the case.

--- src/org/igniterealtime/xiff/im/Roster.as
+++ src/org/igniterealtime/xiff/im/Roster.as
@@ -23,16 +23,15 @@
  */
 package org.igniterealtime.xiff.im
 {
+	import flash.events.EventDispatcher;
+
 	import mx.collections.ArrayCollection;
-
-	import flash.events.EventDispatcher;
-	import flash.utils.Dictionary;
-
+
 	import org.igniterealtime.xiff.core.*;
 	import org.igniterealtime.xiff.data.*;
 	import org.igniterealtime.xiff.data.im.*;
 	import org.igniterealtime.xiff.events.*;
-
+
 	/**
 	 * Broadcast whenever someone revokes your presence subscription. This is not
 	 * an event that is fired when you revoke a subscription, but rather when one of your
@@ -107,43 +106,39 @@
 	 */
 	public class Roster extends ArrayCollection
 	{
+
+		private static var rosterStaticConstructed:Boolean = RosterStaticConstructor();
+
+		private static const staticConstructorDependencies:Array = [ ExtensionClassRegistry,
+																	 RosterExtension ]
+
 		private var _connection:XMPPConnection;
-
+
+		/**
+		 * Store groups as RosterGroup.
+		 */
+		private var _groups:Object = {};
+
+		/**
+		 * Store presences of the people in users roster.
+		 */
+		private var _presenceMap:Object = {};
+
 		//FIXME: does not support multiple pending requests
 		private var pendingSubscriptionRequestJID:UnescapedJID;
-
-		/**
-		 * Store presences of the people in users roster.
-		 */
-		private var _presenceMap:Dictionary;
-
-		/**
-		 * Store groups as RosterGroup.
-		 */
-		private var _groups:Dictionary;
-
-		private static const staticConstructorDependencies:Array = [
-			ExtensionClassRegistry,
-			RosterExtension
-		]
-
-		private static var rosterStaticConstructed:Boolean = RosterStaticConstructor();
-
+
 		/**
 		 *
 		 * @param	aConnection A reference to an XMPPConnection class instance
 		 */
 		public function Roster( aConnection:XMPPConnection = null )
 		{
-			_presenceMap = new Dictionary();
-			_groups = new Dictionary();
-
-			if (aConnection != null)
+			if ( aConnection != null )
 			{
 				connection = aConnection;
 			}
 		}
-
+
 		/**
 		 *
 		 * @return
@@ -153,7 +148,7 @@
 			ExtensionClassRegistry.register( RosterExtension );
 			return true;
 		}
-
+
 		/**
 		 * Adds a contact to the roster. Remember: All roster data is managed on the server-side,
 		 * so this contact is added to the server-side roster first, and upon successful addition,
@@ -176,12 +171,12 @@
 			{
 				displayName = id.toString();
 			}
-
+
 			var callbackObj:Roster = null;
 			var callbackMethod:String = null;
 			var subscription:String = RosterExtension.SUBSCRIBE_TYPE_NONE;
 			var askType:String = RosterExtension.ASK_TYPE_NONE;
-
+
 			if ( requestSubscription == true )
 			{
 				callbackObj = this;
@@ -190,67 +185,45 @@
 				subscription = RosterExtension.SUBSCRIBE_TYPE_TO;
 				askType = RosterExtension.ASK_TYPE_SUBSCRIBE
 			}
-
-			var tempIQ:IQ = new IQ (null, IQ.SET_TYPE, XMPPStanza.generateID("add_user_"), callbackMethod, callbackObj );
+
+			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "add_user_" ),
+									callbackMethod, callbackObj );
 			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-			ext.addItem( id.escaped, null, displayName, groupName ? [groupName] : null );
+			ext.addItem( id.escaped, null, displayName, groupName ? [ groupName ] :
+						 null );
 			tempIQ.addExtension( ext );
 			_connection.send( tempIQ );
-
-
+
+
 			addRosterItem( id, displayName, RosterExtension.SHOW_PENDING, RosterExtension.SHOW_PENDING,
-				[groupName], subscription, askType );
-		}
-
-		/**
-		 * Requests subscription authorization with a user or service. In the XMPP-world, you cannot receive
-		 * notifications on changes to a contact's presence until that contact has authorized you to subscribe
-		 * to his/her/its presence.
-		 *
-		 * @param	id The JID of the user or service that you wish to subscribe to
-		 * @param	isResponse
-		 * @see	#subscriptionDenial
-		 */
-		public function requestSubscription( id:UnescapedJID, isResponse:Boolean = false):void
-		{
-			// Roster length is 0 if it a response to a user request. we must handle this event.
-			var tempPresence:Presence;
-			if (isResponse)
-			{
-				tempPresence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
-				_connection.send( tempPresence );
-				return;
-			}
-			// Only request for items in the roster
-			if (contains(RosterItemVO.get(id, false)))
-			{
-				tempPresence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
-				_connection.send( tempPresence );
-			}
-		}
-
-		/**
-		 * Removes a contact from the roster and revokes all presence subscriptions for that contact.
-		 * This method will only attempt action if the contact you are trying to remove is currently on the
-		 * roster in the first place.
-		 *
-		 * @param	rosterItem The value object which is to be removed
-		 */
-		public function removeContact( rosterItem:RosterItemVO ):void
-		{
-			if (contains(rosterItem))
-			{
-				var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID("remove_user_"), "unsubscribe_result", this );
-				var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-				ext.addItem( new EscapedJID(rosterItem.jid.bareJID), RosterExtension.SUBSCRIBE_TYPE_REMOVE );
-				tempIQ.addExtension( ext );
-				_connection.send( tempIQ );
-
-				//the roster item is not actually removed from the roster
-				//until confirmation comes back from the XMPP server
-			}
-		}
-
+						   [ groupName ], subscription, askType );
+		}
+
+		/**
+		 *
+		 * @param	resultIQ
+		 */
+		public function addContact_result( resultIQ:IQ ):void
+		{
+			// Contact was added, request subscription
+			requestSubscription( pendingSubscriptionRequestJID );
+			pendingSubscriptionRequestJID = null;
+		}
+
+		/**
+		 * Revokes an existing presence subscription or denies a subscription request. If a user
+		 * has sent you a subscription request you can use this method to deny that request. Otherwise,
+		 * if a user already has a granted presence subscription, you can use this method to revoke that
+		 * subscription.
+		 *
+		 * @param	tojid The JID of the user or service that you are denying subscription
+		 */
+		public function denySubscription( tojid:UnescapedJID ):void
+		{
+			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.UNSUBSCRIBED_TYPE );
+			_connection.send( tempPresence );
+		}
+
 		/**
 		 * Fetches the roster data from the server. Once the data has been fetched, the Roster's data
 		 * provider is populated appropriately. If the Roster-XMPPConnection class dependency has been
@@ -259,11 +232,92 @@
 		 */
 		public function fetchRoster():void
 		{
-			var tempIQ:IQ = new IQ( null, IQ.GET_TYPE, XMPPStanza.generateID("roster_"), "fetchRoster_result", this );
+			var tempIQ:IQ = new IQ( null, IQ.GET_TYPE, XMPPStanza.generateID( "roster_" ),
+									"fetchRoster_result", this );
 			tempIQ.addExtension( new RosterExtension( tempIQ.getNode() ) );
 			_connection.send( tempIQ );
 		}
-
+
+		/**
+		 *
+		 * @param	resultIQ
+		 */
+		public function fetchRoster_result( resultIQ:IQ ):void
+		{
+			// Clear out the old roster
+			removeAll();
+			try
+			{
+				disableAutoUpdate();
+				for each ( var ext:RosterExtension in resultIQ.getAllExtensionsByNS( RosterExtension.NS ) )
+				{
+					for each ( var item:*in ext.getAllItems() )
+					{
+						//var classInfo:XML = flash.utils.describeType(item);
+						if ( !item is XMLStanza )
+						{
+							continue;
+						}
+
+						var askType:String = item.askType != null ? item.askType.toLowerCase() :
+							RosterExtension.ASK_TYPE_NONE;
+						addRosterItem( new UnescapedJID( item.jid ), item.name, RosterExtension.SHOW_UNAVAILABLE,
+									   "Offline", item.groupNames, item.subscription.toLowerCase(),
+									   askType );
+					}
+				}
+				enableAutoUpdate();
+
+				// Fire Roster Loaded Event
+				var rosterEvent:RosterEvent = new RosterEvent( RosterEvent.ROSTER_LOADED,
+															   false, false );
+				dispatchEvent( rosterEvent );
+			}
+			catch ( e:Error )
+			{
+				trace( e.getStackTrace() );
+			}
+		}
+
+		/**
+		 *
+		 * @param	item
+		 * @return
+		 */
+		public function getContainingGroups( item:RosterItemVO ):Array
+		{
+			var result:Array = [];
+			for ( var key:String in _groups )
+			{
+				var group:RosterGroup = _groups[ key ] as RosterGroup;
+				if ( group.contains( item ) )
+				{
+					result.push( group );
+				}
+			}
+			return result;
+		}
+
+		/**
+		 * Get a group by given name
+		 * @param	name
+		 * @return
+		 */
+		public function getGroup( name:String ):RosterGroup
+		{
+			return _groups[ name ] as RosterGroup;
+		}
+
+		/**
+		 * Get the Presence of the given user if any.
+		 * @param	jid
+		 * @return
+		 */
+		public function getPresence( jid:UnescapedJID ):Presence
+		{
+			return _presenceMap[ jid.toString() ] as Presence;
+		}
+
 		/**
 		 * Grants a user or service authorization for subscribing to your presence. Once authorization
 		 * is granted, the user can see whether you are offline, online, away, etc. Subscriptions can
@@ -277,91 +331,64 @@
 		{
 			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.SUBSCRIBED_TYPE );
 			_connection.send( tempPresence );
-
+
 			// Request a return subscription
 			if ( requestAfterGrant )
 			{
 				requestSubscription( tojid, true );
 			}
 		}
-
-		/**
-		 * Revokes an existing presence subscription or denies a subscription request. If a user
-		 * has sent you a subscription request you can use this method to deny that request. Otherwise,
-		 * if a user already has a granted presence subscription, you can use this method to revoke that
-		 * subscription.
-		 *
-		 * @param	tojid The JID of the user or service that you are denying subscription
-		 */
-		public function denySubscription( tojid:UnescapedJID ):void
-		{
-			var tempPresence:Presence = new Presence( tojid.escaped, null, Presence.UNSUBSCRIBED_TYPE );
-			_connection.send( tempPresence );
-		}
-
-		/**
-		 * Updates the information for an existing contact. You can use this method to change the
-		 * display name or associated group for a contact in your roster.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newName The new display name for this contact
-		 * @param	newGroups The new groups to associate the contact with
-		 */
-		private function updateContact( rosterItem:RosterItemVO, newName:String, groupNames:Array ):void
-		{
-			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID("update_contact_") );
-			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
-
-			ext.addItem( rosterItem.jid.escaped, rosterItem.subscribeType, newName, groupNames );
-			tempIQ.addExtension( ext );
-			_connection.send( tempIQ );
-		}
-
-		/**
-		 * Updates the display name for an existing contact.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newName The new display name for this contact
-		 */
-		public function updateContactName( rosterItem:RosterItemVO, newName:String ):void
-		{
-			var groupNames:Array = [];
-			for each(var group:RosterGroup in getContainingGroups(rosterItem))
-			{
-				groupNames.push(group.label);
-			}
-			updateContact( rosterItem, newName, groupNames);
-		}
-
-		/**
-		 *
-		 * @param	item
-		 * @return
-		 */
-		public function getContainingGroups(item:RosterItemVO):Array
-		{
-			var result:Array = [];
-			for each(var group:RosterGroup in _groups)
-			{
-				if (group.contains(item))
-				{
-					result.push(group);
-				}
-			}
-			return result;
-		}
-
-		/**
-		 * Updates the groups associated with an existing contact.
-		 *
-		 * @param	rosterItem The value object of the contact to update
-		 * @param	newGroups The new groups to associate the contact with
-		 */
-		public function updateContactGroups( rosterItem:RosterItemVO, newGroupNames:Array ):void
-		{
-			updateContact( rosterItem, rosterItem.displayName, newGroupNames );
-		}
-
+
+		/**
+		 * Removes a contact from the roster and revokes all presence subscriptions for that contact.
+		 * This method will only attempt action if the contact you are trying to remove is currently on the
+		 * roster in the first place.
+		 *
+		 * @param	rosterItem The value object which is to be removed
+		 */
+		public function removeContact( rosterItem:RosterItemVO ):void
+		{
+			if ( contains( rosterItem ) )
+			{
+				var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "remove_user_" ),
+										"unsubscribe_result", this );
+				var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
+				ext.addItem( new EscapedJID( rosterItem.jid.bareJID ), RosterExtension.SUBSCRIBE_TYPE_REMOVE );
+				tempIQ.addExtension( ext );
+				_connection.send( tempIQ );
+
+				//the roster item is not actually removed from the roster
+				//until confirmation comes back from the XMPP server
+			}
+		}
+
+		/**
+		 * Requests subscription authorization with a user or service. In the XMPP-world, you cannot receive
+		 * notifications on changes to a contact's presence until that contact has authorized you to subscribe
+		 * to his/her/its presence.
+		 *
+		 * @param	id The JID of the user or service that you wish to subscribe to
+		 * @param	isResponse
+		 * @see	#subscriptionDenial
+		 */
+		public function requestSubscription( id:UnescapedJID, isResponse:Boolean = false ):void
+		{
+			// Roster length is 0 if it a response to a user request. we must handle this event.
+			var presence:Presence;
+			if ( isResponse )
+			{
+				presence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
+				_connection.send( presence );
+				return;
+			}
+			// Only request for items in the roster
+			if ( contains( RosterItemVO.get( id, false ) ) )
+			{
+				presence = new Presence( id.escaped, null, Presence.SUBSCRIBE_TYPE );
+				_connection.send( presence );
+			}
+		}
+
 		/**
 		 * Sets your current presence status. Calling this method notifies others who
 		 * are subscribed to your presence of a presence change. You should use this to
@@ -383,69 +410,77 @@
 		 */
 		public function setPresence( show:String, status:String, priority:Number ):void
 		{
-			//var tempPresence:Presence = new Presence( null, null, Presence.AVAILABLE_TYPE, show, status, priority );
-			var tempPresence:Presence = new Presence( null, null, null, show, status, priority );
-			_connection.send( tempPresence );
-		}
-
+			var presence:Presence = new Presence( null, null, null, show, status,
+													  priority );
+			_connection.send( presence );
+		}
+
 		/**
 		 *
 		 * @param	resultIQ
 		 */
-		public function fetchRoster_result( resultIQ:IQ ):void
-		{
-			// Clear out the old roster
-			removeAll();
-			try
-			{
-				disableAutoUpdate();
-				for each(var ext:RosterExtension in resultIQ.getAllExtensionsByNS( RosterExtension.NS ))
-				{
-					for each(var item:* in ext.getAllItems())
-					{
-						//var classInfo:XML = flash.utils.describeType(item);
-						if (!item is XMLStanza)
-						{
-							continue;
-						}
-
-						var askType:String = item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE;
-						addRosterItem( new UnescapedJID(item.jid), item.name, RosterExtension.SHOW_UNAVAILABLE,
-							"Offline", item.groupNames, item.subscription.toLowerCase(), askType);
-					}
-				}
-				enableAutoUpdate();
-
-				// Fire Roster Loaded Event
-				var rosterEvent:RosterEvent = new RosterEvent(RosterEvent.ROSTER_LOADED, false, false);
-				dispatchEvent(rosterEvent);
-			}
-			catch (e:Error)
-			{
-				trace(e.getStackTrace());
-			}
-		}
-
-		/**
-		 *
-		 * @param	resultIQ
-		 */
-		public function addContact_result( resultIQ:IQ ):void
-		{
-			// Contact was added, request subscription
-			requestSubscription( pendingSubscriptionRequestJID );
-			pendingSubscriptionRequestJID = null;
-		}
-
-		/**
-		 *
-		 * @param	resultIQ
-		 */
 		public function unsubscribe_result( resultIQ:IQ ):void
 		{
 			// Does nothing for now
 		}
-
+
+		/**
+		 * Updates the groups associated with an existing contact.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newGroups The new groups to associate the contact with
+		 */
+		public function updateContactGroups( rosterItem:RosterItemVO, newGroupNames:Array ):void
+		{
+			updateContact( rosterItem, rosterItem.displayName, newGroupNames );
+		}
+
+		/**
+		 * Updates the display name for an existing contact.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newName The new display name for this contact
+		 */
+		public function updateContactName( rosterItem:RosterItemVO, newName:String ):void
+		{
+			var groupNames:Array = [];
+			for each ( var group:RosterGroup in getContainingGroups( rosterItem ) )
+			{
+				groupNames.push( group.label );
+			}
+			updateContact( rosterItem, newName, groupNames );
+		}
+
+		private function addRosterItem( jid:UnescapedJID, displayName:String, show:String, status:String, groupNames:Array, type:String, askType:String = "none" ):Boolean
+		{
+			if ( !jid )
+			{
+				return false;
+			}
+
+			var rosterItem:RosterItemVO = RosterItemVO.get( jid, true );
+			if ( !contains( rosterItem ) )
+			{
+				addItem( rosterItem );
+			}
+			if ( displayName )
+			{
+				rosterItem.displayName = displayName;
+			}
+			rosterItem.subscribeType = type;
+			rosterItem.askType = askType;
+			rosterItem.status = status;
+			rosterItem.show = show;
+			setContactGroups( rosterItem, groupNames );
+
+			var event:RosterEvent = new RosterEvent( RosterEvent.USER_ADDED );
+			event.jid = jid;
+			event.data = rosterItem;
+			dispatchEvent( event );
+
+			return true;
+		}
+
 		/**
 		 *
 		 * @param	eventObj PresenceEvent, LoginEvent or RosterExtension
@@ -453,13 +488,13 @@
 		private function handleEvent( eventObj:* ):void
 		{

-			switch( eventObj.type )
+			switch ( eventObj.type )
 			{
 				// Handle any incoming presence items
 				case PresenceEvent.PRESENCE:
 					handlePresences( eventObj.data );
 					break;
-
+
 				// Fetch the roster immediately after login
 				case LoginEvent.LOGIN:
 					fetchRoster();
@@ -467,207 +502,191 @@
 					//setPresence( Presence.SHOW_NORMAL, "Online", 5 );
 					setPresence( null, "Online", 5 );
 					break;
-
+
 				case RosterExtension.NS:
 					try
 					{
-						var ext:RosterExtension = (eventObj.iq as IQ).getAllExtensionsByNS( RosterExtension.NS )[0] as RosterExtension;
+						var ext:RosterExtension = ( eventObj.iq as IQ ).getAllExtensionsByNS( RosterExtension.NS )[ 0 ] as
+							RosterExtension;
 						var items:Array = ext.getAllItems();
-						for each(var item:* in items)
+						for each ( var item:*in items )
 						{
-							var jid:UnescapedJID = new UnescapedJID(item.jid);
-							var rosterItemVO:RosterItemVO = RosterItemVO.get(jid, true);
+							var jid:UnescapedJID = new UnescapedJID( item.jid );
+							var rosterItemVO:RosterItemVO = RosterItemVO.get( jid,
+																			  true );
 							var rosterEvent:RosterEvent;
-
-							if (contains(rosterItemVO))
+
+							if ( contains( rosterItemVO ) )
 							{
-								switch (item.subscription.toLowerCase())
+								switch ( item.subscription.toLowerCase() )
 								{
 									case RosterExtension.SUBSCRIBE_TYPE_NONE:
-										rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_REVOCATION);
+										rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_REVOCATION );
 										rosterEvent.jid = jid;
 										dispatchEvent( rosterEvent );
 										break;
-
+
 									case RosterExtension.SUBSCRIBE_TYPE_REMOVE:
-										rosterEvent = new RosterEvent(RosterEvent.USER_REMOVED);
-										for each(var group:RosterGroup in getContainingGroups(rosterItemVO))
+										rosterEvent = new RosterEvent( RosterEvent.USER_REMOVED );
+										for each ( var group:RosterGroup in getContainingGroups( rosterItemVO ) )
 										{
-											group.removeItem(rosterItemVO);
+											group.removeItem( rosterItemVO );
 										}
 										//should be impossible for getItemIndex to return -1, since we just looked it up
-										rosterEvent.data = removeItemAt(getItemIndex(rosterItemVO));;
+										rosterEvent.data = removeItemAt( getItemIndex( rosterItemVO ) );;
 										rosterEvent.jid = jid;
 										dispatchEvent( rosterEvent );
 										break;
-
+
 									default:
-										updateRosterItemSubscription(rosterItemVO, item.subscription.toLowerCase(), item.name, item.groupNames);
+										updateRosterItemSubscription( rosterItemVO,
+																	  item.subscription.toLowerCase(),
+																	  item.name,
+																	  item.groupNames );
 										break;
 								}
 							}
 							else
 							{
 								var groupNames:Array = item.groupNames;
-								var askType:String = item.askType != null ?
-									item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE;
+								var askType:String = item.askType != null ? item.askType.toLowerCase() :
+									RosterExtension.ASK_TYPE_NONE;

 								if ( item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_REMOVE &&
-									item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_NONE)
+									item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_NONE )
 								{
 									// Add this item to the roster if it's not there and if the subscription type is not equal to 'remove' or 'none'
-									addRosterItem( jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline",
-										groupNames, item.subscription.toLowerCase(), askType );
+									addRosterItem( jid, item.name, RosterExtension.SHOW_UNAVAILABLE,
+												   "Offline", groupNames, item.subscription.toLowerCase(),
+												   askType );
 								}
-								else if ( (item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_NONE ||
-									item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_FROM) &&
-										item.askType == RosterExtension.ASK_TYPE_SUBSCRIBE )
+								else if ( ( item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_NONE ||
+									item.subscription.toLowerCase() == RosterExtension.SUBSCRIBE_TYPE_FROM ) &&
+									item.askType == RosterExtension.ASK_TYPE_SUBSCRIBE )
 								{
 									// A contact was added to the roster, and its authorization is still pending.
-									addRosterItem( jid, item.name, RosterExtension.SHOW_PENDING, "Pending", groupNames,
-										item.subscription.toLowerCase(), askType );
+									addRosterItem( jid, item.name, RosterExtension.SHOW_PENDING,
+												   "Pending", groupNames, item.subscription.toLowerCase(),
+												   askType );
 								}
 							}
 						}
 					}
-					catch (e:Error)
+					catch ( e:Error )
 					{
-						trace(e.getStackTrace());
+						trace( e.getStackTrace() );
 					}
 					break;
 			}
 		}
-
+
 		/**
 		 * Dispathing <code>RosterEvent</code> based on the types of the <code>Presence</code>.
 		 * @param	presenceArray	A pile of presences received at one time
 		 */
-		private function handlePresences( presenceArray:Array):void
-		{
-			for each(var aPresence:Presence in presenceArray)
-			{
-				var type:String = aPresence.type ? aPresence.type.toLowerCase() : null;
+		private function handlePresences( presenceArray:Array ):void
+		{
+			for each ( var aPresence:Presence in presenceArray )
+			{
+				var type:String = aPresence.type ? aPresence.type.toLowerCase() :
+					null;
 				var rosterEvent:RosterEvent = null;
-
-				switch( type )
+
+				switch ( type )
 				{
 					case Presence.SUBSCRIBE_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_REQUEST);
+						rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_REQUEST );
 						break;
-
+
 					case Presence.UNSUBSCRIBED_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.SUBSCRIPTION_DENIAL);
+						rosterEvent = new RosterEvent( RosterEvent.SUBSCRIPTION_DENIAL );
 						break;
-
+
 					case Presence.UNAVAILABLE_TYPE:
-						rosterEvent = new RosterEvent(RosterEvent.USER_UNAVAILABLE);
-
-						var unavailableItem:RosterItemVO = RosterItemVO.get(aPresence.from.unescaped, false);
-						if(!unavailableItem) return;
+						rosterEvent = new RosterEvent( RosterEvent.USER_UNAVAILABLE );
+
+						var unavailableItem:RosterItemVO = RosterItemVO.get( aPresence.from.unescaped,
+																			 false );
+						if ( !unavailableItem )
+							return;
 						updateRosterItemPresence( unavailableItem, aPresence );
-
+
 						break;
-
+
 					// null means available
 					default:
-						rosterEvent = new RosterEvent(RosterEvent.USER_AVAILABLE);
+						rosterEvent = new RosterEvent( RosterEvent.USER_AVAILABLE );
 						rosterEvent.data = aPresence;
-
+
 						// Change the item on the roster
 						var availableItem:RosterItemVO;
-						if(aPresence.from)
-							availableItem = RosterItemVO.get(aPresence.from.unescaped, false);
-
-						if(!availableItem) return;
+						if ( aPresence.from )
+							availableItem = RosterItemVO.get( aPresence.from.unescaped,
+															  false );
+
+						if ( !availableItem )
+							return;
 						updateRosterItemPresence( availableItem, aPresence );
-
+
 						break;
 				}
-
-				if (rosterEvent != null)
+
+				if ( rosterEvent != null )
 				{
 					// from can sometimes not be set
-					if (aPresence.from)
+					if ( aPresence.from )
 					{
 						rosterEvent.jid = aPresence.from.unescaped;
 					}
-					dispatchEvent(rosterEvent);
+					dispatchEvent( rosterEvent );
 				}
 			}
 		}
-
-		private function addRosterItem( jid:UnescapedJID, displayName:String, show:String, status:String, groupNames:Array, type:String, askType:String = "none" ):Boolean
-		{
-			if (!jid)
-			{
-				return false;
-			}
-
-			var rosterItem:RosterItemVO = RosterItemVO.get(jid, true);
-			if (!contains( rosterItem ))
-			{
-				addItem( rosterItem );
-			}
-			if (displayName)
-			{
-				rosterItem.displayName = displayName;
-			}
-			rosterItem.subscribeType = type;
-			rosterItem.askType = askType;
-			rosterItem.status = status;
-			rosterItem.show = show;
-			setContactGroups(rosterItem, groupNames);
-
-			var event:RosterEvent = new RosterEvent(RosterEvent.USER_ADDED);
-			event.jid = jid;
-			event.data = rosterItem;
-			dispatchEvent(event);
-
-			return true;
-		}
-
+
 		private function setContactGroups( contact:RosterItemVO, groupNames:Array ):void
 		{
-			if (!groupNames || groupNames.length == 0)
-			{
-				groupNames = ["General"];
-			}
-			for each(var name:String in groupNames)
+			if ( !groupNames || groupNames.length == 0 )
+			{
+				groupNames = [ "General" ];
+			}
+			for each ( var name:String in groupNames )
 			{
 				//if there's no group by this name already, we need to make one
-				if(!getGroup(name))
-					_groups[name] = new RosterGroup(name);
-			}
-			for each(var group:RosterGroup in _groups)
-			{
-				if (groupNames.indexOf(group.label) >= 0)
+				if ( !getGroup( name ) )
+					_groups[ name ] = new RosterGroup( name );
+			}
+			for each ( var group:RosterGroup in _groups )
+			{
+				if ( groupNames.indexOf( group.label ) >= 0 )
 				{
-					group.addItem(contact);
+					group.addItem( contact );
 				}
 				else
 				{
-					group.removeItem(contact);
+					group.removeItem( contact );
 				}
 			}
 		}
-
-		private function updateRosterItemSubscription( item:RosterItemVO, type:String, name:String, newGroupNames:Array ):void
-		{
-			item.subscribeType = type;
-
-			setContactGroups(item, newGroupNames);
-
-			if (name)
-			{
-				item.displayName = name;
-			}
-
-			var event:RosterEvent = new RosterEvent(RosterEvent.USER_SUBSCRIPTION_UPDATED);
-			event.jid = item.jid;
-			event.data = item;
-			dispatchEvent(event);
-		}
-
+
+		/**
+		 * Updates the information for an existing contact. You can use this method to change the
+		 * display name or associated group for a contact in your roster.
+		 *
+		 * @param	rosterItem The value object of the contact to update
+		 * @param	newName The new display name for this contact
+		 * @param	newGroups The new groups to associate the contact with
+		 */
+		private function updateContact( rosterItem:RosterItemVO, newName:String, groupNames:Array ):void
+		{
+			var tempIQ:IQ = new IQ( null, IQ.SET_TYPE, XMPPStanza.generateID( "update_contact_" ) );
+			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
+
+			ext.addItem( rosterItem.jid.escaped, rosterItem.subscribeType, newName,
+						 groupNames );
+			tempIQ.addExtension( ext );
+			_connection.send( tempIQ );
+		}
+
 		private function updateRosterItemPresence( item:RosterItemVO, presence:Presence ):void
 		{
 			try
@@ -675,48 +694,45 @@
 				item.status = presence.status;
 				item.show = presence.show;
 				item.priority = presence.priority;
-				if (!presence.type)
+				if ( !presence.type )
 				{
 					item.online = true;
 				}
-				else if (presence.type == Presence.UNAVAILABLE_TYPE)
+				else if ( presence.type == Presence.UNAVAILABLE_TYPE )
 				{
 					item.online = false;
 				}
-
-				var event:RosterEvent = new RosterEvent(RosterEvent.USER_PRESENCE_UPDATED);
+
+				var event:RosterEvent = new RosterEvent( RosterEvent.USER_PRESENCE_UPDATED );
 				event.jid = item.jid;
 				event.data = item;
-				dispatchEvent(event);
-
-				_presenceMap[item.jid.toString()] = presence;
-			}
-			catch (e:Error)
-			{
-				trace(e.getStackTrace());
-			}
-		}
-
-		/**
-		 * Get the Presence of the given user if any.
-		 * @param	jid
-		 * @return
-		 */
-		public function getPresence(jid:UnescapedJID):Presence
-		{
-			return _presenceMap[jid.toString()] as Presence;
-		}
-
-		/**
-		 * Get a group by given name
-		 * @param	name
-		 * @return
-		 */
-		public function getGroup(name:String):RosterGroup
-		{
-			return _groups[name] as RosterGroup;
-		}
-
+				dispatchEvent( event );
+
+				_presenceMap[ item.jid.toString() ] = presence;
+			}
+			catch ( e:Error )
+			{
+				trace( e.getStackTrace() );
+			}
+		}
+
+		private function updateRosterItemSubscription( item:RosterItemVO, type:String, name:String, newGroupNames:Array ):void
+		{
+			item.subscribeType = type;
+
+			setContactGroups( item, newGroupNames );
+
+			if ( name )
+			{
+				item.displayName = name;
+			}
+
+			var event:RosterEvent = new RosterEvent( RosterEvent.USER_SUBSCRIPTION_UPDATED );
+			event.jid = item.jid;
+			event.data = item;
+			dispatchEvent( event );
+		}
+
 		/**
 		 * The instance of the XMPPConnection class to use for the roster to use for
 		 * sending and receiving data.
@@ -725,17 +741,18 @@
 		{
 			return _connection;
 		}
+
 		public function set connection( value:XMPPConnection ):void
 		{
 			_connection = value;
-			_connection.addEventListener(PresenceEvent.PRESENCE, handleEvent);
-			_connection.addEventListener(LoginEvent.LOGIN, handleEvent);
+			_connection.addEventListener( PresenceEvent.PRESENCE, handleEvent );
+			_connection.addEventListener( LoginEvent.LOGIN, handleEvent );
 			_connection.addEventListener( RosterExtension.NS, handleEvent );
 		}
-
+
 		public override function set filterFunction(f:Function):void
 		{
-			throw new Error("Setting the filterFunction on Roster is not allowed; Wrap it in a ListCollectionView and filter that.");
+			throw new Error( "Setting the filterFunction on Roster is not allowed; Wrap it in a ListCollectionView and filter that." );
 		}
 	}
 }


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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

 package spark.skins.mobile
 {