Fix a string concatenation and some minor cleanup

--- runtime/src/main/as/flump/display/Movie.as
+++ runtime/src/main/as/flump/display/Movie.as
@@ -178,20 +178,34 @@

     /** Advances the playhead by the give number of seconds. From IAnimatable. */
     public function advanceTime (dt :Number) :void {
-        if (dt < 0) throw new Error("Invalid time [dt=" + dt + "]");
-        if (_skipAdvanceTime) { _skipAdvanceTime = false; return; }
-        if (_state == STOPPED) return;
+        if (dt < 0) {
+            throw new Error("Invalid time [dt=" + dt + "]");
+        }
+
+        if (_skipAdvanceTime) {
+            _skipAdvanceTime = false;
+            return;
+        }
+
+        if (_state == STOPPED) {
+            return;
+        }

         if (_state == PLAYING && _numFrames > 1) {
             _playTime += dt;
             var actualPlaytime :Number = _playTime;
-            if (_playTime >= _duration) _playTime %= _duration;
+            if (_playTime >= _duration) {
+                _playTime %= _duration;
+            }

             // If _playTime is very close to _duration, rounding error can cause us to
             // land on lastFrame + 1. Protect against that.
             var newFrame :int = int(_playTime * _frameRate);
-            if (newFrame < 0) newFrame = 0;
-            if (newFrame >= _numFrames) newFrame = _numFrames - 1;
+            if (newFrame < 0) {
+                newFrame = 0;
+            } else if (newFrame >= _numFrames) {
+                newFrame = _numFrames - 1;
+            }

             // If the update crosses or goes to the stopFrame:
             // go to the stopFrame, stop the movie, clear the stopFrame
@@ -233,8 +247,8 @@
         // if no contents exist, simply include this movie's position in the bounds
         if (resultRect.isEmpty()) {
             getTransformationMatrix(targetSpace, IDENTITY_MATRIX);
-            MatrixUtil.transformCoords(IDENTITY_MATRIX, 0.0, 0.0, _s_helperPoint);
-            resultRect.setTo(_s_helperPoint.x, _s_helperPoint.y, 0, 0);
+            MatrixUtil.transformCoords(IDENTITY_MATRIX, 0.0, 0.0, HELPER_POINT);
+            resultRect.setTo(HELPER_POINT.x, HELPER_POINT.y, 0, 0);
         }

         return resultRect;
@@ -270,17 +284,16 @@
      */
     protected function updateFrame (newFrame :int, dt :Number) :void {
         if (newFrame < 0 || newFrame >= _numFrames) {
-            throw new Error("Invalid frame [frame=" + newFrame,
-                " validRange=0-" + (_numFrames - 1) + "]");
+            throw new Error("Invalid frame [frame=" + newFrame + ", validRange=0-" + (_numFrames - 1) + "]");
         }

         if (_isUpdatingFrame) {
             _pendingFrame = newFrame;
             return;
-        } else {
-            _pendingFrame = NO_FRAME;
-            _isUpdatingFrame = true;
-        }
+        }
+
+        _pendingFrame = NO_FRAME;
+        _isUpdatingFrame = true;

         const isGoTo :Boolean = (dt <= 0);
         const wrapped :Boolean = (dt >= _duration) || (newFrame < _frame);
@@ -291,7 +304,9 @@
             }
         }

-        if (isGoTo) _playTime = newFrame / _frameRate;
+        if (isGoTo) {
+            _playTime = newFrame / _frameRate;
+        }

         // Update the frame before firing frame label signals, so if firing changes the frame,
         // it sticks.
@@ -307,7 +322,9 @@
         } else {
             startFrame = (oldFrame + 1 < _numFrames ? oldFrame + 1 : 0);
             frameCount = (_frame - oldFrame);
-            if (wrapped) frameCount += _numFrames;
+            if (wrapped) {
+                frameCount += _numFrames;
+            }
         }

         // Fire signals. Stop if pendingFrame is updated, which indicates that the client
@@ -350,7 +367,9 @@
     /** @private */
     protected var _state :int = PLAYING;
     /** @private */
-    protected var _playTime :Number, _duration :Number;
+    protected var _playTime :Number = 0;
+    /** @private */
+    protected var _duration :Number;
     /** @private */
     protected var _layers :Vector.<Layer>;
     /** @private */
@@ -363,9 +382,8 @@
     private var _skipAdvanceTime :Boolean = false;
     /** @private */
     internal var _playerData :MoviePlayerNode;
-    /** @private */
-    private static var _s_helperPoint :Point = new Point();
-
+
+    private static const HELPER_POINT :Point = new Point();
     private static const IDENTITY_MATRIX :Matrix = new Matrix();

     private static const NO_FRAME :int = -1;


Apply formatting.

Apply formatting.

--- src/com/esri/builder/controllers/RemoveCustomWidgetController.as
+++ src/com/esri/builder/controllers/RemoveCustomWidgetController.as
@@ -16,10 +16,10 @@
 package com.esri.builder.controllers
 {

+import com.esri.builder.controllers.supportClasses.WellKnownDirectories;
 import com.esri.builder.controllers.supportClasses.processes.CleanUpProcess;
 import com.esri.builder.controllers.supportClasses.processes.ProcessArbiter;
 import com.esri.builder.controllers.supportClasses.processes.ProcessArbiterEvent;
-import com.esri.builder.controllers.supportClasses.WellKnownDirectories;
 import com.esri.builder.eventbus.AppEvent;
 import com.esri.builder.model.WidgetType;
 import com.esri.builder.model.WidgetTypeRegistryModel;


prevent scrolling in HUD

prevent scrolling in HUD

--- src/battlecode/client/viewer/render/DrawHUD.as
+++ src/battlecode/client/viewer/render/DrawHUD.as
@@ -44,6 +44,9 @@
             width = 180;
             percentHeight = 100;
             autoLayout = false;
+
+            horizontalScrollPolicy = "off";
+            verticalScrollPolicy = "off";

             pointLabel = new Label();
             pointLabel.width = width;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8574
Author:   aharui@adobe.com
Date:     2009-07-15T05:33:44.225721Z

Log Message:
-----------
Bugs related to TLF and focus.  Also TLF Marshall Plan adjustments, and some IME fixes

QE Notes: None
Doc Notes: None
Bugs: SDK-21278, SDK-21686, SDK-21375, SDK-18516, SDK-15093, SDK-21335
Reviewer: darrell, carol
tests: checkintests mustella/gumbo mustella/components

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/IFocusManagerComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IIMESupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/alertClasses/AlertForm.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework_textLayout/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/RichEditableTextContainerManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.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/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.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/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.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/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/marshalClasses/FocusManagerMarshalMixin.as</path>

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

--- frameworks/projects/framework/src/mx/controls/SWFLoader.as
+++ frameworks/projects/framework/src/mx/controls/SWFLoader.as
@@ -384,8 +384,6 @@
     {
         super();

-        // SWFLoader generally load interactive content.
-        tabChildren = true;
         tabEnabled = false;

         addEventListener(FlexEvent.INITIALIZE, initializeHandler);


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

--- frameworks/projects/framework/src/mx/states/SetProperty.as
+++ frameworks/projects/framework/src/mx/states/SetProperty.as
@@ -1,13 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
 //
-//  AdobePatentID="B770"
+//  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: 4960
Author:   gosmith@adobe.com
Date:     2009-02-14T02:23:27.721068Z

Log Message:
-----------
Decreased the number of Gumbo style buckets.

Combined AdvancedCharacterFormatTextStyles.as, AdvancedParagraphFormatTextStyles.as, and AdvancedContainerFormatTextStyles.as into AdvancedTextLayoutFormatStyles.as.

Combined BasicCharacterFormatTextStyles.as, BasicParagraphFormatTextStyles.as, and BasicContainerFormatTextStyles.as into BasicTextLayoutFormatStyles.as.

The reason for doing this is that TLF combined its CharacterFormat, ParagraphFormat, and ContainerFormat classes into a single TextLayoutFormat.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: None; no functional change

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicContainerFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicParagraphFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedContainerFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -37,12 +37,8 @@
 //  Styles
 //--------------------------------------

-include "../styles/metadata/BasicContainerFormatTextStyles.as"
-include "../styles/metadata/AdvancedContainerFormatTextStyles.as"
-include "../styles/metadata/BasicParagraphFormatTextStyles.as"
-include "../styles/metadata/AdvancedParagraphFormatTextStyles.as"
-include "../styles/metadata/BasicCharacterFormatTextStyles.as"
-include "../styles/metadata/AdvancedCharacterFormatTextStyles.as"
+include "../styles/metadata/AdvancedTextLayoutFormatStyles.as"
+include "../styles/metadata/BasicTextLayoutFormatStyles.as"

 //--------------------------------------
 //  Other metadata


Transferred from the Adobe Open Source Subversion Repository

Revision: 4661
Author:   cframpto@adobe.com
Date:     2009-01-25T21:08:04.606967Z

Log Message:
-----------
Handle TextFlow's damage event for TextView and TextGraphic.  This event indicates the TextFlow was modified programatically.

QE Notes:
Doc Notes:
Bugs: SDK-18749
Reviewers: will be Gordan

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

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -23,6 +23,7 @@
 import flashx.textLayout.elements.ParagraphElement;
 import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
+import flashx.textLayout.events.DamageEvent;
 import flashx.textLayout.formats.CharacterFormat;
 import flashx.textLayout.formats.ContainerFormat;
 import flashx.textLayout.formats.ICharacterFormat;
@@ -196,6 +197,12 @@
      */
     private var textInvalid:Boolean = false;

+    /**
+     *  @private
+     *  This flag is set to true if the text must be clipped.
+     */
+    private var isOverset:Boolean = false;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties
@@ -361,11 +368,13 @@
         if (!mx_internal::styleChainInitialized)
             return;

-        compose(explicitWidth, explicitHeight);
+        isOverset = compose(explicitWidth, explicitHeight);

         var bounds:Rectangle = textFlowComposer.bounds;
         measuredWidth = Math.ceil(bounds.width);
         measuredHeight = Math.ceil(bounds.height);
+
+        //trace("measure", explicitWidth, explicitHeight, measuredWidth, measuredHeight);
     }

     /**
@@ -374,6 +383,8 @@
     override protected function updateDisplayList(unscaledWidth:Number,
                                                   unscaledHeight:Number):void
     {
+        //trace("updateDisplayList", unscaledWidth, unscaledHeight);
+
         super.updateDisplayList(unscaledWidth, unscaledHeight);

         // The updateDisplayList() method of a GraphicElement can get called
@@ -382,12 +393,18 @@
         if (!mx_internal::styleChainInitialized)
             return;

-        var overset:Boolean = compose(unscaledWidth, unscaledHeight);
-
+        // If both width and height are specified, then measure isn't called
+        // and measuredWidth/Height will remain 0.  In this case the compose
+        // will always be done here.  Otherwise measure will compose and set
+        // measuredWidth/Height/isOverset.  If the unscaledWidth/Height is the
+        // same as measuredWidth/Height there is no need to redo the compose.
+        if (unscaledWidth != measuredWidth || unscaledHeight != measuredHeight)
+            isOverset = compose(unscaledWidth, unscaledHeight);
+
         // Use scrollRect to clip overset lines.
         // But don't read or write scrollRect if you can avoid it,
         // because this causes Player 10.0 to allocate memory.
-        if (overset)
+        if (isOverset)
         {
             displayObject.scrollRect =
                 new Rectangle(0, 0, unscaledWidth, unscaledHeight);
@@ -398,6 +415,10 @@
             displayObject.scrollRect = null;
             mx_internal::hasScrollRect = false;
         }
+
+        // Listen for "damage" events in case the textFlow is
+        // modified programatically.
+        textFlow.addEventListener(DamageEvent.DAMAGE, textFlow_damageHandler);
     }

     /**
@@ -644,6 +665,39 @@

         return textFlowComposer.isOverset;
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Called when the TextFlow dispatches a 'damage' event
+     *  to indicate it has been modified.
+     */
+    private function textFlow_damageHandler(
+                            event:DamageEvent):void
+    {
+        //trace("damageHandler", "damageStart", event.damageStart, "damageLength", event.damageLength);
+
+        // Don't want this handler firing when we're re-composing the text lines
+        // to handle the "damage".
+        textFlow.removeEventListener(DamageEvent.DAMAGE, textFlow_damageHandler);
+
+        // The text flow changed.  It could have been either/or content or
+        // styles within the flow.
+        contentChanged = true;
+
+        // Unless both width/height were specified, need to recalc size.
+        if (isNaN(explicitWidth) || isNaN(explicitHeight))
+            invalidateSize();
+
+        // Force the text lines to be re-composed.  The handler will be
+        // re-added.
+        invalidateDisplayList();
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 16679
Author:   rfrishbe@adobe.com
Date:     2010-06-25T21:09:29.726791Z

Log Message:
-----------
Check-in for touch lists so that List item renderers don't highlight immediately, and they are cancellable after a scroll starts.  In addition, in touch mode, we don't get a select event until mouse up.

QE notes: None
Doc notes: None
Bugs: -
Reviewer: None - this will get reviewed later
Tests run: checkintests, full mustella run (some tests failed and were off by a few pixels)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -1404,6 +1404,7 @@
 //                scrollDragStartEvent.scrollingObject = scroller;
 //                scroller.dispatchEvent(scrollDragStartEvent);
                 scrollStartPoint = new Point(mouseEvent.stageX, mouseEvent.stageY);
+                mouseDownedPoint = new Point(mouseEvent.stageX, mouseEvent.stageY);
             }

             // only need to do this stuff once per target
@@ -1590,6 +1591,8 @@
         lastVelocity.x /= lastTime;
         lastVelocity.y /= lastTime;

+        var scrollEndEvent:TouchScrollEvent;
+
         // FIXME (rfrishbe): should be minXVelocity, minYVelocity, minDiagonalVelocity
         // FIXME (rfrishbe): this should be parameterized better
         if ( (lastTime >= 3*averageTime) &&
@@ -1598,13 +1601,12 @@
             isScrolling = false;

             // don't do anything
-            var scrollEndEvent:TouchScrollEvent = new TouchScrollEvent(TouchScrollEvent.TOUCH_SCROLL_END);
+            scrollEndEvent = new TouchScrollEvent(TouchScrollEvent.TOUCH_SCROLL_END);
             scrollEndEvent.scrollingObject = scroller;
             scroller.dispatchEvent(scrollEndEvent);
             return;
         }

-
         var velocities:Vector.<Point> = calculateVelocity(clickHistory, timeHistory);

         var velocityWeights:Vector.<Number> = Vector.<Number>([1,1.33,1.66,2]);
@@ -1620,6 +1622,15 @@
             scroller.addEventListener(TouchScrollEvent.TOUCH_SCROLL_THROW_ANIMATION_END, scroller_touchScrollThrowAnimationEnd);
             scroller.dispatchEvent(scrollEndAndThrowEvent);
         }
+        else
+        {
+            isScrolling = false;
+
+            // don't do anything
+            scrollEndEvent = new TouchScrollEvent(TouchScrollEvent.TOUCH_SCROLL_END);
+            scrollEndEvent.scrollingObject = scroller;
+            scroller.dispatchEvent(scrollEndEvent);
+        }

         // if we own this user gesture, don't let others see this event
 //        if (isScrolling)


fix ensureDeferredHScrollBarCreated being called twice

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -2854,7 +2854,7 @@
                 // In case we're not in touch mode, we need to instantiate our deferred skin parts immediately
                 // TODO (egeorgie): support deferred scrollbar parts in non-touch mode
                 ensureDeferredHScrollBarCreated();
-                ensureDeferredHScrollBarCreated();
+                ensureDeferredVScrollBarCreated();

                 uninstallTouchListeners();


Transferred from the Adobe Open Source Subversion Repository

Revision: 3703
Author:   pfarland@adobe.com
Date:     2008-10-17T13:49:24.719479Z

Log Message:
-----------
This change removes the temporary skin class dependencies from Link and TextArea and fixes pre-link's resolution of nested style dependencies. This change splits the compiler's PreLink phase into two parts – the first part deals with the main compilation unit (handling things like defaults.css styles and their dependencies) which we now do repeatedly until we find that no more dependencies are linked in (from nested skin/style/skin/style chains). The second part then codegens the main init and loader code – but we only do this after we've found all of those style dependencies (as we need the full list of mixins).

QA: Yes
Doc: No
Checkintests: Pass
Reviewer: Darrell
Bugs:
SDK-17222 - Gumbo TextArea control isnt bringing in the necessary ScrollBar skins

Modified Paths:
--------------
<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/modules/compiler/src/java/flex2/tools/CompcPreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxTextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/PreLink.java</path>

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -36,10 +36,6 @@
 {
     include "../core/Version.as";

-    // Force a dependency on FxHScrollBar and FxVScrollBar to work around bug SDK-17222
-    private static var hScrollDep:FxHScrollBar;
-    private static var vScrollDep:FxVScrollBar;
-
     //--------------------------------------------------------------------------
     //
     //  Constructor


Transferred from the Adobe Open Source Subversion Repository

Revision: 8385
Author:   smgilson@adobe.com
Date:     2009-07-06T19:38:43.090419Z

Log Message:
-----------
ASDoc updates for Spark layouts and core

QE Notes: None
Doc Notes: None
Bugs: -
checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/RowAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/ISharedDisplayObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/MaskType.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/NavigationUnit.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/HorizontalAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/DisplayObjectSharingMode.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/ColumnAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/layouts/TileOrientation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>

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

--- frameworks/projects/spark/src/spark/core/NavigationUnit.as
+++ frameworks/projects/spark/src/spark/core/NavigationUnit.as
@@ -14,17 +14,18 @@
 import flash.ui.Keyboard;

 /**
- *  Enumerated type for the IViewport getVerticalScrollPositionDelta(),
- *  getHorizontalScrollPositionDelta() and
- *  getNavigationDestinationIndex() methods.
+ *  The NavigationUnit class defines the possible values for the
+ *  getVerticalScrollPositionDelta() and
+ *  getHorizontalScrollPositionDelta()
+ *  methods of the IViewport class.
  *
- *  All of these constants have the same values as their flash.ui.Keyboard
+ *
All of these constants have the same values as their flash.ui.Keyboard
  *  counterparts, except PAGE_LEFT and PAGE_RIGHT, for which no keyboard
- *  key equivalents exist.
+ *  key equivalents exist.

  *
+ *  @see flash.ui.Keyboard
  *  @see IViewport#getVerticalScrollPositionDelta
  *  @see IViewport#getHorizontalScrollPositionDelta
- *  @see LayoutBase#getNavigationDestinationIndex
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


added description to reprojection task

added description to reprojection task

Change-Id: I878545bd1d819ec1baae23f67d7f8888b33b71f1

--- WeaveData/src/weave/data/ProjectionManager.as
+++ WeaveData/src/weave/data/ProjectionManager.as
@@ -459,7 +459,7 @@
 		else
 		{
 			// TODO - assess priority assignment
-			WeaveAPI.StageUtils.startTask(reprojectedColumn, asyncIterate, WeaveAPI.TASK_PRIORITY_NORMAL, asyncComplete);
+			WeaveAPI.StageUtils.startTask(reprojectedColumn, asyncIterate, WeaveAPI.TASK_PRIORITY_NORMAL, asyncComplete, lang("Reprojecting {0} geometries in {1}", keys.length, debugId(unprojectedColumn)));
 		}
 	}


Video's been broken for a little while, but I had removed all my video
objects so was not seeing NPEs that others were.
Fixed.

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

--- src/as/com/threerings/util/MediaContainer.as
+++ src/as/com/threerings/util/MediaContainer.as
@@ -25,6 +25,9 @@

 import flash.media.Video;

+import flash.text.TextField;
+import flash.text.TextFieldAutoSize;
+
 import flash.system.ApplicationDomain;
 import flash.system.LoaderContext;
 import flash.system.SecurityDomain;
@@ -121,6 +124,15 @@
      */
     protected function setupVideo (url :String) :void
     {
+        // TODO: re-implement video without flex
+        var tf :TextField = new TextField();
+        tf.autoSize = TextFieldAutoSize.LEFT;
+        tf.text = "Video is temporarily disabled";
+        tf.background = true;
+        tf.selectable = false;
+        tf.width = tf.textWidth + 5;
+        setMediaObject(tf);
+
 //        var vid :VideoDisplay = new VideoDisplay();
 //        vid.autoPlay = false;
 //        _media = vid;


初始化ByteArray时position为0

--- as3/com/netease/protobuf/stringToByteArray.as
+++ as3/com/netease/protobuf/stringToByteArray.as
@@ -11,8 +11,9 @@
 	import flash.utils.ByteArray
 	public function stringToByteArray(s:String):ByteArray {
 		const ba:ByteArray = new ByteArray
+		ba.length = s.length
 		for (var i:uint = 0; i < s.length; ++i) {
-			ba.writeByte(s.charCodeAt(i))
+			ba[i] = s.charCodeAt(i)
 		}
 		return ba
 	}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17942
Author:   chiedozi@adobe.com
Date:     2010-09-29T22:17:47.195538Z

Log Message:
-----------
Renamed ViewHistoryData to ViewProxy
Added a context parameter to pushView that allows context information to be passed to a new view
View.returnedObject was moved to ViewNavigator and is now typed ViewReturnObject.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewHistoryData.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewHistoryData.as" copyfrom-rev="17889" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -227,7 +227,7 @@
     }

     //----------------------------------
-    //  desctructionPolicy
+    //  destructionPolicy
     //----------------------------------

     [Inspectable(category="General", enumeration="auto,always,never", defaultValue="auto")]
@@ -262,22 +262,38 @@
     public var navigator:ViewNavigator;

     //----------------------------------
-    //  returnedObject
-    //----------------------------------
-
-    /**
-     *  An object that was returned by the previous view when
-     *  the navigator is popping back to this view.
+    //  context
+    //----------------------------------
+
+    private var _context:String = null;
+
+    /**
+     *  The string that describes the context in which this view was
+     *  created.  This property is assigned to the context
+     *  parameter that is passed into ViewNavigator.pushView().
      *
      *  @default null
      *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public var returnedObject:Object;
-
+     *  @see spark.components.ViewNavigator
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get context():String
+    {
+        return _context;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function setContext(value:String):void
+    {
+        _context = value;
+    }
+
     //--------------------------------------------------------------------------
     //
     //  UI Template Properties


Added a method to ensure a particular capacity for client preferences.
We'll call this with a big fat number whenever a non-guest logs in. The
first time we ask, the user will authorize the big fat storage, and it will
never ask again. Hopefully we can make it look like part of the login...

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

--- src/as/com/threerings/util/Config.as
+++ src/as/com/threerings/util/Config.as
@@ -1,6 +1,9 @@
 package com.threerings.util {

+import flash.events.NetStatusEvent;
+
 import flash.net.SharedObject;
+import flash.net.SharedObjectFlushStatus;

 public class Config
 {
@@ -40,6 +43,46 @@
         _so.flush(); // flushing is not strictly necessary
     }

+    /**
+     * Ensure that we can store preferences up to the specified size.
+     * Note that calling this method may pop up a dialog to the user, asking
+     * them if it's ok to increase the capacity. The result listener may
+     * never be called if the user doesn't answer the pop-up.
+     *
+     * @param rl an optional listener that will be informed as to whether
+     * the request succeeded.
+     */
+    public function ensureCapacity (kilobytes :int, rl :ResultListener) :void
+    {
+        // flush with the size, see if we're cool
+        var result :String = _so.flush(1024 * kilobytes);
+        if (rl == null) {
+            return;
+        }
+
+        // success
+        if (result == SharedObjectFlushStatus.FLUSHED) {
+            rl.requestCompleted(this);
+            return;
+        }
+
+        // otherwise we'll hear back in a sec
+        var thisConfig :Config = this;
+        var listener :Function = function (evt :NetStatusEvent) :void {
+                // TODO: as of beta3 there is a bug where the status
+                // is always "SharedObject.Flush.Failed", even on success
+                //trace("================[" + evt.info.code + "]");
+                if ("SharedObject.Flush.Success" == evt.info.code) {
+                    rl.requestCompleted(thisConfig);
+                } else {
+                    rl.requestFailed(new Error(String(evt.info.code)));
+                }
+                _so.removeEventListener(NetStatusEvent.NET_STATUS, listener);
+            };
+
+        _so.addEventListener(NetStatusEvent.NET_STATUS, listener);
+    }
+
     /** The shared object that contains our preferences. */
     protected var _so :SharedObject;
 }


Required version of Flash Player is checked now.

--- src/microphone.as
+++ src/microphone.as
@@ -14,7 +14,8 @@
     import flash.events.SampleDataEvent;
     import flash.external.ExternalInterface;
     import flash.system.Security;
-
+    import flash.system.Capabilities;
+
     public class microphone extends Sprite {

         private var mic:Microphone    = null;
@@ -27,13 +28,25 @@
         private var id:String = null;

         public function microphone() {
-
+
+            var flashPlayerVersion:String = Capabilities.version;
+            var osArray:Array = flashPlayerVersion.split(' ');
+            var versionArray:Array = osArray[1].split(',');
+            var majorVersion:Number = parseInt(versionArray[0]);
+            var majorRevision:Number = parseInt(versionArray[1])/10;
+
             var options:Object = this.loaderInfo.parameters;
-
+
             debugging = options.debugging  || false;
             JSObject  = options.objectName || "Mic";
             mode      = options.mode       || RECORD;
             id        = options.id;
+
+            if(majorVersion + majorRevision < 10.1){
+                ExternalInterface.call(JSObject + '.error', id , 3, 'Flash Player 10.1 or above is required');
+                ExternalInterface.call('console.log','Flash player does not support samplesAvailable event');
+                return;
+            }

             Security.showSettings("2");

@@ -43,13 +56,12 @@

                 mic.addEventListener(StatusEvent.STATUS,statusHandler);
                 mic.addEventListener(ActivityEvent.ACTIVITY,activityHandler);
-               // mic.codec = SoundCodec.SPEEX;
-               // mic.enableVAD = true;
+                mic.codec = SoundCodec.SPEEX;
+                mic.enableVAD = true;
                 mic.setSilenceLevel(1, 1000);
                 mic.setUseEchoSuppression(true);
                 mic.setLoopBack(true);
-                mic.gain = 80;
-               // mic.rate = 8;
+                mic.gain = 50;

            		ExternalInterface.addCallback("setMic", setMic);
     			ExternalInterface.addCallback("getMicrophoneList", getMicrophoneList);
@@ -63,13 +75,12 @@
     			ExternalInterface.addCallback("stop", stop);

             }else if(Microphone.isSupported === false){
-                error(1,"Microphone usage is not supported.");
-                log("Microphone usage is not supported.");
+                this.error(1,"Microphone usage is not supported.");
+                this.log("Microphone usage is not supported.");
             }else{
-                error(2,"No microphone detected.");
-                log("No microphone detected.");
+                this.error(2,"No microphone detected.");
+                this.log("No microphone detected.");
             }
-
             ExternalInterface.call(JSObject + '.loaded',id);
         }

@@ -77,6 +88,7 @@
             if(mode == RECORD){
             }else if(mode == STREAM){
                 log('started');
+
                 mic.addEventListener(SampleDataEvent.SAMPLE_DATA,streamHandler);
             }
         }


added checks for null

added checks for null

--- WeaveJS/src/weavejs/core/SessionManager.as
+++ WeaveJS/src/weavejs/core/SessionManager.as
@@ -219,6 +219,8 @@
 		 */
 		public function getSessionStateTree(root:ILinkableObject, objectName:String):WeaveTreeItem
 		{
+			if (!root)
+				return null;
 			var treeItem:WeaveTreeItem = d2d_object_name_tree.get(root, objectName);
 			if (!treeItem.data)
 			{
@@ -1096,7 +1098,7 @@

 		public function getPath(root:ILinkableObject, descendant:ILinkableObject):Array
 		{
-			if (!descendant)
+			if (!root || !descendant)
 				return null;
 			var tree:WeaveTreeItem = getSessionStateTree(root, null);
 			var path:Array = _getPath(tree, descendant);


Update FMSBridge.as

Update FMSBridge.as

--- examples/web/app/classes/server/FMSBridge.as
+++ examples/web/app/classes/server/FMSBridge.as
@@ -20,6 +20,7 @@

 		public function dispose():void {
 			connection.dispose();
+			client.dispose();
 		}

 		public function close():void {


added optional callback params to LinkableWatcher constructor.

--- WeaveCore/src/weave/core/LinkableWatcher.as
+++ WeaveCore/src/weave/core/LinkableWatcher.as
@@ -36,12 +36,20 @@
 		 * Instead of calling this constructor directly, consider using one of the global functions
 		 * newLinkableChild() or newDisposableChild() to make sure the watcher will get disposed automatically.
 		 * @param typeRestriction Optionally restricts which type of targets this watcher accepts.
+		 * @param immediateCallback A function to add as an immediate callback.
+		 * @param groupedCallback A function to add as a grouped callback.
 		 * @see weave.api.core.newLinkableChild()
 		 * @see weave.api.core.newDisposableChild()
 		 */
-		public function LinkableWatcher(typeRestriction:Class = null)
+		public function LinkableWatcher(typeRestriction:Class = null, immediateCallback:Function = null, groupedCallback:Function = null)
 		{
 			_typeRestriction = typeRestriction;
+
+			if (immediateCallback != null)
+				WeaveAPI.SessionManager.getCallbackCollection(this).addImmediateCallback(null, immediateCallback);
+
+			if (groupedCallback != null)
+				WeaveAPI.SessionManager.getCallbackCollection(this).addGroupedCallback(null, groupedCallback);
 		}

 		private var _typeRestriction:Class;


refactor Matrix4x4.transformVector() to use Matrix3D.transformVectors() instead of Matrix3D.transformVector() and avoid Vector3D instanciations

--- src/aerys/minko/type/math/Matrix4x4.as
+++ src/aerys/minko/type/math/Matrix4x4.as
@@ -327,10 +327,15 @@
 		public function transformVector(input 	: Vector4,
 									    output	: Vector4	= null) : Vector4
 		{
-			var v : Vector3D = _matrix.transformVector(input._vector);
-
+			TMP_VECTOR[0] = input.x;
+			TMP_VECTOR[1] = input.y;
+			TMP_VECTOR[2] = input.z;
+			TMP_VECTOR.length = 3;
+
+			_matrix.transformVectors(TMP_VECTOR, TMP_VECTOR);
+
 			output ||= new Vector4();
-			output.set(v.x, v.y, v.z, v.w);
+			output.set(TMP_VECTOR[0], TMP_VECTOR[1], TMP_VECTOR[2], 1);

 			return output;
 		}


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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 7803
Author:   dsubrama@adobe.com
Date:     2009-06-12T22:33:24.106666Z

Log Message:
-----------
Metadata needed by Bangalore team for event-handler generation.

Bug: http://bugs.adobe.com/jira/browse/SDK-21632
Checkintests: Pass
Reviewer: Ryan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TabBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.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/ToggleButtonBar.as</path>

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

--- frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -34,8 +34,13 @@
  */
 [Style(name="contentBackgroundColor", type="uint", format="Color", inherit="yes", theme="spark")]

+//--------------------------------------
+//  Other metadata
+//--------------------------------------

 [IconFile("NumericStepper.png")]
+[DefaultTriggerEvent("change")]
+
 /**
  *  The NumericStepper control lets you select
  *  a number from an ordered set.


Modify KrewAsync a little

Modify KrewAsync a little

--- krew-framework/krewfw/utils/as3/KrewAsync.as
+++ krew-framework/krewfw/utils/as3/KrewAsync.as
@@ -134,6 +134,7 @@
             }
             if (asyncDef is KrewAsync) {
                 _initWithKrewAsync(asyncDef);
+                return;
             }
             if (asyncDef is Array) {
                 _initWithArray(asyncDef);


???? construct ??

???? construct ??

--- as3/com/netease/protobuf/messageToString.as
+++ as3/com/netease/protobuf/messageToString.as
@@ -28,14 +28,14 @@
 		return s
 	}
 }
-
+import com.netease.protobuf.*
 function fieldToString(message:Object, descriptor:XML, name:String):String {
 	var hasField:String = "has" + name.charAt(0).toUpperCase() + name.substr(1)
 	if (descriptor.accessor.(@name == hasField).length() != 0 && !message[hasField]) {
 		return ""
 	}
 	var field:* = message[name]
-	if (field != null && field.constructor == Array && field.length == 0) {
+	if (field != null && !(field is Message || field is ExtensibleMessage) && field is Array && field.length == 0) {
 		return ""
 	}
 	return name + "=" + field + ";\n"


Added verifier function.

Added verifier function.

Change-Id: Icc2a034c291b0c454cdd3f2d9e81d153fbeda412

--- WeaveData/src/weave/data/KeySets/KeySet.as
+++ WeaveData/src/weave/data/KeySets/KeySet.as
@@ -25,10 +25,10 @@

 	import weave.api.WeaveAPI;
 	import weave.api.copySessionState;
+	import weave.api.getSessionState;
+	import weave.api.setSessionState;
 	import weave.api.data.IKeySet;
 	import weave.api.data.IQualifiedKey;
-	import weave.api.getSessionState;
-	import weave.api.setSessionState;
 	import weave.compiler.StandardLib;
 	import weave.core.LinkableVariable;

@@ -41,9 +41,20 @@
 	{
 		public function KeySet()
 		{
-			super(Array);
+			super(Array, verifySessionState);
 			// The first callback will update the keys from the session state.
 			addImmediateCallback(this, updateKeys);
+		}
+
+		/**
+		 * Verifies that the value is a two-dimensional array or null.
+		 */
+		private function verifySessionState(value:Array):Boolean
+		{
+			for each (var row:Object in value)
+				if (!(row is Array))
+					return false;
+			return true;
 		}

 		/**
@@ -313,12 +324,11 @@
 					if (value[keyTypeProperty] != null && value[keysProperty] != null)
 						value = WeaveAPI.CSVParser.createCSVToken(value[keyTypeProperty]) + ',' + value[keysProperty];
 			}
-			// backwards compatibility -- parse CSV
+			// backwards compatibility -- parse CSV String
 			if (value is String)
 				value = WeaveAPI.CSVParser.parseCSV(value as String);

 			// expecting a two-dimensional Array at this point
-			// TODO: error checking?
 			super.setSessionState(value);
 		}


added missing toObject() type info

added missing toObject() type info

--- WeaveASJS/src/weavejs/core/LinkableHashMap.as
+++ WeaveASJS/src/weavejs/core/LinkableHashMap.as
@@ -70,7 +70,7 @@
 			return getList(true, filter, filterIncludesPlaceholders);
 		}

-		public function toObject(filter:Class = null, filterIncludesPlaceholders:Boolean = false):Object
+		public function toObject/*/<T>/*/(filter:/*/new(..._:any[])=>T | string/*/Class = null, filterIncludesPlaceholders:Boolean = false):/*/{[name:string]: T & ILinkableObject}/*/Object
 		{
 			var obj:Object = {};
 			for each (var name:String in getList(false, filter, filterIncludesPlaceholders))


Added support for {bbox} and {size} in tile URL

--- WeaveData/src/weave/services/wms/CustomWMS.as
+++ WeaveData/src/weave/services/wms/CustomWMS.as
@@ -19,6 +19,7 @@
 	import weave.api.primitives.IBounds2D;
 	import weave.api.registerLinkableChild;
 	import weave.api.reportError;
+	import weave.compiler.StandardLib;
 	import weave.core.LinkableNumber;
 	import weave.core.LinkableString;
 	import weave.data.ProjectionManager;
@@ -76,9 +77,11 @@
 			if(!wmsURL.value)
 				return;

-			//http://tiles.domain.com/layer/{z}/{x}/{y}.png
-
-			var basicReq:String = getTileUrls(new Coordinate(0,0,0));
+			//http://tiles.domain.com/layer/{z}/{x}/{y}.png
+			getAllowedBounds(_tempBounds);
+			_tempBounds2.setBounds(0, 0, 256, 256);
+
+			var basicReq:String = getTileUrl(new Coordinate(0,0,0), _tempBounds, _tempBounds2);
 			var instance:CustomWMS = this;
 			WeaveAPI.URLRequestUtils.getContent(
 				this,
@@ -107,10 +110,11 @@
 		{
 			if(_currentTileIndex == null || !wmsURL.value || !imageAttributesSet)
 				return [];
+
 			var i:int
-			var copyDataBounds:Bounds2D = _tempBounds3;
+			var thisTile:Bounds2D = _tempBounds2;
+			var tempDataBounds:Bounds2D = _tempBounds3;
 			var latLonCopyDataBounds:Bounds2D = _tempBounds4;
-

 			// first determine zoom level using all of the data bounds in lat/lon
 			setTempCoordZoomLevel(dataBounds, screenBounds, preferLowerQuality); // this sets _tempCoord.zoom
@@ -128,43 +132,36 @@
 			}

 			// now determine the data bounds we need to covert in lat/lon
-			copyDataBounds.copyFrom(dataBounds);
+			tempDataBounds.copyFrom(dataBounds);
 			getAllowedBounds(_tempBounds);
-			_tempBounds.constrainBounds(copyDataBounds, false);
-			setReprojectedBounds(copyDataBounds, latLonCopyDataBounds, tileProjectionSRS.value, "EPSG:4326");
-
-			var latLonViewingDataBounds:Bounds2D = latLonCopyDataBounds;
-			var tileXYBounds:Bounds2D = _tempBounds2;
+			_tempBounds.constrainBounds(tempDataBounds, false);
+			setReprojectedBounds(tempDataBounds, latLonCopyDataBounds, tileProjectionSRS.value, "EPSG:4326");
+
 			// calculate min and max tile x and y for the zoom level
 			var zoomScale:Number = Math.pow(2, _tempCoord.zoom);
-			dataBoundsToTileXY(latLonViewingDataBounds, tileXYBounds, zoomScale);
+			dataBoundsToTileXY(latLonCopyDataBounds, thisTile, zoomScale);

-			var xTileMin:Number = tileXYBounds.xMin;
-			var yTileMin:Number = tileXYBounds.yMin;
-			var xTileMax:Number = tileXYBounds.xMax;
-			var yTileMax:Number = tileXYBounds.yMax;
-
-			var mercatorTileXYBounds:Bounds2D = _tempBounds2;
-			var latLonTileXYBounds:Bounds2D = _tempBounds3;
-			tileXYToDataBounds(tileXYBounds, latLonTileXYBounds, zoomScale);
-			setReprojectedBounds(latLonTileXYBounds, mercatorTileXYBounds, "EPSG:4326", tileProjectionSRS.value);
+			var xTileMin:Number = thisTile.xMin;
+			var yTileMin:Number = thisTile.yMin;
+			var xTileMax:Number = thisTile.xMax;
+			var yTileMax:Number = thisTile.yMax;
+
+			tileXYToDataBounds(thisTile, tempDataBounds, zoomScale);
+			setReprojectedBounds(tempDataBounds, thisTile, "EPSG:4326", tileProjectionSRS.value);
 			getAllowedBounds(_tempBounds);
-			_tempBounds.constrainBounds(mercatorTileXYBounds);
+			_tempBounds.constrainBounds(thisTile);

 			// get tiles we need using the map's mercator projection because the tiles' bounds must be in this projection
-			var lowerQualTiles:Array = _currentTileIndex.getTiles(mercatorTileXYBounds, 0, _tempCoord.zoom - 1);
-			var completedTiles:Array = _currentTileIndex.getTiles(mercatorTileXYBounds, _tempCoord.zoom, _tempCoord.zoom);
+			var lowerQualTiles:Array = _currentTileIndex.getTiles(thisTile, 0, _tempCoord.zoom - 1);
+			var completedTiles:Array = _currentTileIndex.getTiles(thisTile, _tempCoord.zoom, _tempCoord.zoom);
 			for (var x:int = xTileMin; x < xTileMax; ++x)
 			{
 				for (var y:int = yTileMin; y < yTileMax; ++y)
 				{
-					var thisTileXY:Bounds2D = _tempBounds2;
-					var thisTileLatLon:Bounds2D = _tempBounds3;
-					var thisTileMercator:Bounds2D = _tempBounds2;
-					thisTileXY.setBounds(x, y, x + 1, y + 1);
-					tileXYToDataBounds(thisTileXY, thisTileLatLon, zoomScale);
-					setReprojectedBounds(thisTileLatLon, thisTileMercator, "EPSG:4326", tileProjectionSRS.value);
+					thisTile.setBounds(x, y, x + 1, y + 1);
+					tileXYToDataBounds(thisTile, tempDataBounds, zoomScale);
+					setReprojectedBounds(tempDataBounds, thisTile, "EPSG:4326", tileProjectionSRS.value);

 					_tempCoord.row = y;
 					_tempCoord.column = x;
@@ -174,7 +171,9 @@
 //						continue;

 					// get the tile URLs
-					var requestString:String = getTileUrls(_tempCoord);
+					_tempBounds.copyFrom(thisTile)
+					dataBounds.projectCoordsTo(_tempBounds, screenBounds);
+					var requestString:String = getTileUrl(_tempCoord, thisTile, _tempBounds);
 					if(requestString == null)
 						continue;
 					if (_urlToTile[requestString] != undefined)
@@ -182,7 +181,7 @@

 					var urlRequest:URLRequest = new URLRequest(requestString);
 					// note that thisTileMercator is still in Mercator coords
-					var newTile:WMSTile = registerLinkableChild(this, new WMSTile(thisTileMercator, _imageWidth, _imageHeight, urlRequest));
+					var newTile:WMSTile = registerLinkableChild(this, new WMSTile(thisTile, _imageWidth, _imageHeight, urlRequest));
 					newTile.zoomLevel = _tempCoord.zoom; // need to manually set it so tileIndex queries work
 					_urlToTile[requestString] = newTile;
 					_pendingTiles.push(newTile);
@@ -207,74 +206,74 @@
 		 * @param sourceSRS The SRS code of the source projection.
 		 * @param destSRS The SRS code of the destination projection.
 		 */
-		private function setReprojectedBounds(sourceBounds:IBounds2D, destBounds:IBounds2D, sourceSRS:String, destSRS:String):void
-		{
-			sourceBounds.getMinPoint(_tempPoint);
+		private function setReprojectedBounds(input:IBounds2D, output:IBounds2D, sourceSRS:String, destSRS:String):void
+		{
+			input.getMinPoint(_tempPoint);
 			WeaveAPI.ProjectionManager.transformPoint(sourceSRS, destSRS, _tempPoint);
-			destBounds.setMinPoint(_tempPoint);
-			sourceBounds.getMaxPoint(_tempPoint);
+			output.setMinPoint(_tempPoint);
+			input.getMaxPoint(_tempPoint);
 			WeaveAPI.ProjectionManager.transformPoint(sourceSRS, destSRS, _tempPoint);
-			destBounds.setMaxPoint(_tempPoint);
-
-			destBounds.makeSizePositive();
+			output.setMaxPoint(_tempPoint);
+
+			output.makeSizePositive();
 		}

 		/**
 		 * This function will convert a bounds in lat/long coordinates to tile (x, y) coordinates.
 		 *
-		 * @param sourceBounds The source bounds.
-		 * @param destbounds The destination.
+		 * @param input The input values.
+		 * @param output The output buffer.
 		 * @param zoomScale The value 2^zoom where zoom is the zoom level.
 		 * @return The destination bounds.
 		 */
-		private function dataBoundsToTileXY(sourceBounds:Bounds2D, destBounds:Bounds2D, zoomScale:Number):IBounds2D
-		{
-			sourceBounds.makeSizePositive();
-
-			destBounds.xMin = zoomScale * (sourceBounds.xMin + 180) / 360.0;
-			destBounds.xMax = zoomScale * (sourceBounds.xMax + 180) / 360.0;
-
-			var latRadians:Number = sourceBounds.yMin * Math.PI / 180;
-			destBounds.yMin = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
-			latRadians = sourceBounds.yMax * Math.PI / 180;
-			destBounds.yMax = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
-
-			destBounds.makeSizePositive();
-
-			destBounds.xMin = Math.floor(destBounds.xMin);
-			destBounds.yMin = Math.floor(destBounds.yMin);
-			destBounds.xMax = Math.ceil(destBounds.xMax);
-			destBounds.yMax = Math.ceil(destBounds.yMax);
+		private function dataBoundsToTileXY(input:Bounds2D, output:Bounds2D, zoomScale:Number):IBounds2D
+		{
+			input.makeSizePositive();
+
+			output.xMin = zoomScale * (input.xMin + 180) / 360.0;
+			output.xMax = zoomScale * (input.xMax + 180) / 360.0;
+
+			var latRadians:Number = input.yMin * Math.PI / 180;
+			output.yMin = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
+			latRadians = input.yMax * Math.PI / 180;
+			output.yMax = zoomScale * (1 - (Math.log(Math.tan(latRadians) + (1 / Math.cos(latRadians))) / Math.PI)) / 2.0;
+
+			output.makeSizePositive();
+
+			output.xMin = Math.floor(output.xMin);
+			output.yMin = Math.floor(output.yMin);
+			output.xMax = Math.ceil(output.xMax);
+			output.yMax = Math.ceil(output.yMax);

 			// although this may allow the max values to be zoomScale, which is 1 larger than number of tiles,
 			// it's not a problem because the tile starting at zoomScale,zoomScale is never requested.
 			_tempBounds.setBounds(0, 0, zoomScale, zoomScale);
-			_tempBounds.constrainBounds(destBounds, false);
-
-			return destBounds;
+			_tempBounds.constrainBounds(output, false);
+
+			return output;
 		}

 		/**
 		 * This function will convert bounds from tile x,y coordinates to Latitude and Longitude coordinates.
-		 * @param sourceBounds The source.
-		 * @param destBounds The destination.
+		 * @param input The input values.
+		 * @param output The output buffer.
 		 * @param zoomScale The value 2^zoom.
 		 * @return The destBounds.
 		 */
-		private function tileXYToDataBounds(sourceBounds:Bounds2D, destBounds:Bounds2D, zoomScale:Number):IBounds2D
-		{
-			destBounds.xMin = 360 * (sourceBounds.xMin / zoomScale) - 180.0;
-			destBounds.xMax = 360 * (sourceBounds.xMax / zoomScale) - 180.0;
-
-			var latRadians:Number = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * sourceBounds.yMin / zoomScale)));
-			destBounds.yMin = latRadians * 180.0 / Math.PI;
-			latRadians = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * sourceBounds.yMax / zoomScale)));
-			destBounds.yMax = latRadians * 180.0 / Math.PI;
-
-			destBounds.makeSizePositive();
-
-			return destBounds;
+		private function tileXYToDataBounds(input:Bounds2D, output:Bounds2D, zoomScale:Number):IBounds2D
+		{
+			output.xMin = 360 * (input.xMin / zoomScale) - 180.0;
+			output.xMax = 360 * (input.xMax / zoomScale) - 180.0;
+
+			var latRadians:Number = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * input.yMin / zoomScale)));
+			output.yMin = latRadians * 180.0 / Math.PI;
+			latRadians = Math.atan(ProjConstants.sinh(Math.PI * (1 - 2 * input.yMax / zoomScale)));
+			output.yMax = latRadians * 180.0 / Math.PI;
+
+			output.makeSizePositive();
+
+			return output;
 		}

 		public const creditInfo:LinkableString = registerLinkableChild(this,new LinkableString(""));
@@ -326,20 +325,18 @@
 				_tempCoord.zoom = higherQualZoomLevel;
 		}

-		private function getTileUrls(coord:Coordinate):String
-		{
-			if(!wmsURL || !wmsURL.value)
+		private function getTileUrl(coord:Coordinate, data:IBounds2D, screen:IBounds2D):String
+		{
+			if (!wmsURL || !wmsURL.value)
 				return null;

-			var url:String = wmsURL.value;
-
-			url= url.replace('{z}','{0}');
-			url= url.replace('{x}','{1}');
-			url= url.replace('{y}','{2}');
-
-			url = StringUtil.substitute(url,coord.zoom.toString(),coord.column.toString(),coord.row.toString());
-
-			return url;
+			return StandardLib.replace(wmsURL.value,
+				'{x}', String(coord.column),
+				'{y}', String(coord.row),
+				'{z}', String(coord.zoom),
+				'{bbox}', [data.getXMin(), data.getYMin(), data.getXMax(), data.getYMax()].join(','),
+				'{size}', [screen.getXCoverage(), screen.getYCoverage()].join(',')
+			);
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 11043
Author:   pfarland@adobe.com
Date:     2009-10-21T02:42:17.501991Z

Log Message:
-----------
Adding support for compile-time optimized FXG 2.0 maskType="luminosity". We generate a symbol class for both the mask and maskee. The mask creates a LuminosityMaskShader and uses it as a filter on the mask display object. As with alpha masks, the maskee must programmatically set cacheAsBitmap to true and the mask at runtime must be set to an item on the display list.

Also adding support for embedded images in compile-time optimized FXG 2.0 <img> rich text nodes. (A minor change was required to the FXGUtils FXGResourceResolver API to resolve file paths so that a qualified path can be created for the generated [Embed] statement that is used for the <img> source).

QE notes: Check with core tech for luminosity mask tests.
Doc notes: N/A
Bugs: SDK-22859 - The image doesn't render at runtime when using the <img /> tag in static FXG
Reviewer: Ryan
Tests run: Checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FlexResourceResolver.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FlexFXG2SWFTranscoder.java</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/LuminosityMaskShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/util/FileResolver.java</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/shaders/LuminosityMaskFilter.pbj</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/fxg/util/FXGResourceResolver.java</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -33,6 +33,7 @@
 import spark.primitives.shaders.ExclusionShader; ExclusionShader;
 import spark.primitives.shaders.HueShader; HueShader;
 import spark.primitives.shaders.LuminosityShader; LuminosityShader;
+import spark.primitives.shaders.LuminosityMaskShader; LuminosityMaskShader;
 import spark.primitives.shaders.SaturationShader; SaturationShader;
 import spark.primitives.shaders.SoftLightShader; SoftLightShader;
 import spark.skins.spark.ApplicationSkin; ApplicationSkin;


I think this has likely never run...

I think this has likely never run...

--- src/main/as/com/threerings/whirled/client/SceneDirector.as
+++ src/main/as/com/threerings/whirled/client/SceneDirector.as
@@ -431,7 +431,7 @@
             } else {
                 log.info("Delaying forced move because we have a move pending",
                     "pendId", _pendingData.sceneId, "reqId", sceneId);
-                addPendingForcedMove(new function() :void {
+                addPendingForcedMove(function() :void {
                     forcedMove(sceneId);
                 });
             }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17275
Author:   aharui@adobe.com
Date:     2010-08-11T18:11:13.759119Z

Log Message:
-----------
Oodles of RET Bugs.  The general theme behind these changes is that we are no longer using the last layout width as the bounds for measurement any more unless explicitWidth or widthInChars is set.  That is required in order to allow the RET to resize as other factors affect its size, but can cause more invalidation in scenarios where the RET's width is not "fixed".  If the extra invalidations prove to be an issue, we will resolve that in a different way.

QE notes: The baselines for the following mustella tests need updating:
	In mustella/gumbo/RichEditableText/Properties: baselines for percentageWidth
	In mustella/gumbo/List/Events: baselines for VRendRET*
Doc notes: none
Bugs: SDK-26479, SDK-26451, SDK-26022, SDK-26155, SDK-25337, SDK-26365, SDK-26350, SDK-26044, SDK-25347
Reviewer: Carol
Tests run: checkintests mustella/gumbo/List mustella/gumbo/RichEditableText
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/halo/defaults.css</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -687,6 +687,11 @@
          */
         private var inMeasureMethod:Boolean = false;

+		/**
+		 *  @private
+		 */
+		private var inUpdateDLMethod:Boolean = false;
+
         /**
          *  @private
          */
@@ -2082,9 +2087,10 @@
                 {
                     _textFlow = staticPlainTextImporter.importToFlow(_text);
                 }
-            }
-
-            // Make sure the interactionManager is added to this textFlow.
+				textFlowChanged = true;
+            }
+
+            // Make sure the interactionManager and controller are added to this textFlow.
             if (textChanged || contentChanged || textFlowChanged)
             {
                 _textContainerManager.setTextFlow(_textFlow);
@@ -2511,7 +2517,13 @@
                     // except if we're using the explicitWidth.
                     bounds = measureTextSize(composeWidth);

-                    measuredWidth = _textContainerManager.compositionWidth;
+					// The measured width shouldn’t be pinned to the composeWidth if
+					// the composeWidth is set by %, otherwise the measuredWidth
+					// can keep stretching
+					if (!isNaN(explicitWidth) || !isNaN(widthInChars))
+						measuredWidth = textContainerManager.compositionWidth;
+					else
+                    	measuredWidth = Math.ceil(bounds.width);
                     measuredHeight = Math.ceil(bounds.bottom);
                 }
                 else if (!isNaN(heightConstraint) || !isNaN(explicitHeight) ||
@@ -2581,6 +2593,8 @@
         override protected function updateDisplayList(unscaledWidth:Number,
                                                       unscaledHeight:Number):void
         {
+			inUpdateDLMethod = true;
+
             //trace("updateDisplayList", unscaledWidth, unscaledHeight, "autoSize", autoSize);

             // Styles can be changed in event handlers while in the middle
@@ -2592,8 +2606,15 @@
             // to be remeasured.  If one of the dimension changes, the text may
             // compose differently and have a different size which the layout
             // manager needs to know.
-            if (autoSize && remeasureText(unscaledWidth, unscaledHeight))
-                return;
+			// Don't exit early if we have changed size.  We may have to run
+			// drawBackgroundAndSetScrollRect
+            if (autoSize &&
+				lastUnscaledHeight == unscaledHeight && lastUnscaledWidth == unscaledWidth &&
+				remeasureText(unscaledWidth, unscaledHeight))
+			{
+				inUpdateDLMethod = false;
+				return;
+			}

             super.updateDisplayList(unscaledWidth, unscaledHeight);

@@ -2644,6 +2665,8 @@

             lastUnscaledWidth = unscaledWidth;
             lastUnscaledHeight = unscaledHeight;
+
+			inUpdateDLMethod = false;
          }

         /**
@@ -2667,10 +2690,44 @@
             // between a measured width/height that is the same as the
             // constrained width/height to know whether that dimension can
             // be sized or must be fixed at the constrained value.
-            widthConstraint = width;
             heightConstraint = height;

             super.setLayoutBoundsSize(width, height, postLayoutTransform);
+
+			// Did we already constrain the width?
+			if (widthConstraint == width)
+				return;
+
+			// No reflow for explicit lineBreak
+			if (getStyle("lineBreak") == "explicit")
+				return;
+
+			// If we don't measure
+			if (canSkipMeasurement())
+				return;
+
+			if (!isNaN(explicitHeight))
+				return;
+
+			// We support reflow only in the case of constrained width and
+			// unconstrained height. Note that we compare with measuredWidth,
+			// as for example the RichEditableText can be
+			// constrained by the layout with "left" and "right", but the
+			// container width itself may not be constrained and it would depend
+			// on the element's measuredWidth.
+			var constrainedWidth:Boolean = !isNaN(width) && (width != measuredWidth) && (width != 0);
+			if (!constrainedWidth)
+				return;
+
+			// We support reflow only when we don't have a transform.
+			// We could add support for scale, but not skew or rotation.
+			if (postLayoutTransform && hasComplexLayoutMatrix)
+				return;
+
+			widthConstraint = width;
+
+			invalidateSize();
+
         }

         /**
@@ -3342,15 +3399,28 @@
                                          composeHeight:Number=NaN):Rectangle
         {
             // Adjust for explicit min/maxWidth so the measurement is accurate.
-            if (isNaN(explicitWidth))
-            {
+			// If no explicitWidth or widthInChars
+            if (isNaN(explicitWidth) && isNaN(widthInChars))
+            {
+				// then if there is an explicit minWidth and
+				// a specified composeWidth and the composeWidth
+				// is less than the minWidth, use the minWidth
                 if (!isNaN(explicitMinWidth) &&
-                    isNaN(composeWidth) || composeWidth < minWidth)
+					!isNaN(composeWidth) && composeWidth < minWidth)
                 {
                     composeWidth = minWidth;
                 }
+				// if composeWidth is NaN, just compose and see what happens
+				// and fix up the measurements afterwards.  See final check
+				// at the end of the method
+
+				// On the other hand, if there is an explicit maxWidth and
+				// no specified composeWidth then use maxWidth,
+				// or if there is a a specified composeWidth
+				// and the composeWidth is greater than maxWidth, use the maxWidth.
                 if (!isNaN(explicitMaxWidth) &&
-                    isNaN(composeWidth) || composeWidth > maxWidth)
+                    isNaN(composeWidth) ||
+					composeWidth > maxWidth)
                 {
                     composeWidth = maxWidth;
                 }
@@ -3372,9 +3442,9 @@
             {
                 _textContainerManager.convertToTextFlowWithComposer();
             }
-
-            // Compose only.  The display should not be updated.
-            _textContainerManager.compose();
+
+			// Compose only.  The display should not be updated.
+			_textContainerManager.compose();

             // Adjust width and height for text alignment.
             var bounds:Rectangle = _textContainerManager.getContentBounds();
@@ -3392,6 +3462,19 @@

             //trace("measureTextSize", composeWidth, "->", bounds.width, composeHeight, "->", bounds.height);

+			// one final check:  If there is no explicitWidth...
+			if (isNaN(explicitWidth) && isNaN(widthInChars))
+			{
+				// but there is a minWidth, and no specified composeWidth
+				// and we measure out to be less than the minWidth
+				// report the minWidth anyway.
+				if (!isNaN(explicitMinWidth) &&
+					isNaN(composeWidth) &&
+					bounds.width < minWidth)
+				{
+					bounds.width = minWidth;
+				}
+			}
             return bounds;
         }

@@ -4078,6 +4161,9 @@
             if (event.damageLength == 0)
                 return;

+			if (inUpdateDLMethod)
+				return;
+
             // Text that is being measured is damaged so update the display.
             if (inMeasureMethod)
             {
@@ -4395,6 +4481,7 @@
                 invalidateDisplayList();
             }
         }
+
     }
-
+
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8401
Author:   smgilson@adobe.com
Date:     2009-07-06T21:34:44.861518Z

Log Message:
-----------
ASDoc on filters/BevelFilter.as

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/ShaderFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/filters/GradientFilter.as</path>

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

--- frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as
+++ frameworks/projects/spark/src/spark/filters/GradientBevelFilter.as
@@ -1,6 +1,6 @@
 package spark.filters
 {
-
+
 import flash.filters.BitmapFilter;
 import flash.filters.GradientBevelFilter;

@@ -11,7 +11,7 @@
 use namespace mx_internal;

 [DefaultProperty("entries")]
-
+

 /**
  * The GradientBevelFilter class lets you apply a gradient bevel effect to
@@ -48,6 +48,14 @@
  * For example, if you zoom in on a large movie clip with a filter applied, the filter is
  * turned off if the resulting image exceeds the maximum dimensions.

  *
+ *  @mxml
+ *
The <GradientBevelFilter> tag inherits all of the tag
+ *  attributes of its superclass and adds no tag attributes:

+ *
+ *

+ *  <GradientBevelFilter/>
+ *

+ *
  * @langversion 3.0
  * @playerversion Flash 10
  * @playerversion AIR 1.5
@@ -61,87 +69,87 @@
  */
 public class GradientBevelFilter extends GradientFilter implements IBitmapFilter
 {
-	/**
-	 * Constructor.
-	 *
-	 * @param distance The offset distance. Valid values are 0 to 8.
-	 * @param angle The angle, in degrees. Valid values are 0 to 360.
-	 * @param colors An array of RGB hexadecimal color values to use in the gradient.
-	 * For example, red is 0xFF0000, blue is 0x0000FF, and so on.
-	 * @param alphas An array of alpha transparency values for the corresponding colors in
-	 * the colors array. Valid values for each element in the array are 0 to 1.
-	 * For example, .25 sets a transparency value of 25%.
-	 * @param ratios An array of color distribution ratios; valid values are
-	 * 0 to 255.
-	 * @param blurX The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or
-	 * less means that the original image is copied as is. The default value
-	 * is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized
-	 * to render more quickly than other values.
-	 * @param blurY The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less
-	 * means that the original image is copied as is. Values that are a power of 2
-	 * (such as 2, 4, 8, 16 and 32) are optimized
-	 * to render more quickly than other values.
-	 * @param strength The strength of the imprint or spread. The higher the value, the more color
-	 * is imprinted and the stronger the contrast between the bevel and the background.
-	 * Valid values are 0 to 255. A value of 0 means that the filter is not applied.
-	 *
-	 * @param quality The quality of the filter. Use BitmapFilterQuality constants:
-	 *

-	 *
BitmapFilterQuality.LOW

-	 *
BitmapFilterQuality.MEDIUM

-	 *
BitmapFilterQuality.HIGH

-	 *

-	 *
For more information, see the description of the quality property.

-	 *
-	 * @param type The placement of the bevel effect. Possible values are BitmapFilterType constants:
-	 *

BitmapFilterType.OUTER — Bevel on the outer edge of the object

-	 *
BitmapFilterType.INNER — Bevel on the inner edge of the object

-	 *
BitmapFilterType.FULL — Bevel on top of the object

-	 *

-	 * @param knockout Specifies whether a knockout effect is applied. The value true
-	 * makes the object's fill transparent and reveals the background color of the document.
-	 *
-	 * @langversion 3.0
-    	 * @playerversion Flash 10
- 	 * @playerversion AIR 1.5
- 	 * @productversion Flex 4
-	 *
-	 */
-	public function GradientBevelFilter(distance:Number = 4.0, angle:Number = 45,
-									    colors:Array = null, alphas:Array = null,
-									    ratios:Array = null, blurX:Number = 4.0,
-									    blurY:Number = 4.0, strength:Number = 1,
-									    quality:int = 1, type:String = "inner",
-									    knockout:Boolean = false)
-	{
-		super(colors, alphas, ratios);
-
-		this.distance = distance;
-		this.angle = angle;
-		this.blurX =blurX ;
-		this.blurY = blurY;
-		this.strength = strength;
-		this.quality = quality;
-		this.type = type;
-		this.knockout = knockout;
-	}
-
-	/**
-	 * Returns a copy of this filter object.
-	 * @return A new GradientBevelFilter instance with all the
-	 * same properties as the original GradientBevelFilter instance.
-	 *
-	 * @langversion 3.0
-    	 * @playerversion Flash 10
- 	 * @playerversion AIR 1.5
- 	 * @productversion Flex 4
-	 */
-	public function clone():BitmapFilter
-	{
-		return new flash.filters.GradientBevelFilter(distance, angle, colors, alphas, ratios,
-										blurX, blurY, strength, quality, type,
-										knockout);
-	}
-
+    /**
+     * Constructor.
+     *
+     * @param distance The offset distance. Valid values are 0 to 8.
+     * @param angle The angle, in degrees. Valid values are 0 to 360.
+     * @param colors An array of RGB hexadecimal color values to use in the gradient.
+     * For example, red is 0xFF0000, blue is 0x0000FF, and so on.
+     * @param alphas An array of alpha transparency values for the corresponding colors in
+     * the colors array. Valid values for each element in the array are 0 to 1.
+     * For example, .25 sets a transparency value of 25%.
+     * @param ratios An array of color distribution ratios; valid values are
+     * 0 to 255.
+     * @param blurX The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or
+     * less means that the original image is copied as is. The default value
+     * is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized
+     * to render more quickly than other values.
+     * @param blurY The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less
+     * means that the original image is copied as is. Values that are a power of 2
+     * (such as 2, 4, 8, 16 and 32) are optimized
+     * to render more quickly than other values.
+     * @param strength The strength of the imprint or spread. The higher the value, the more color
+     * is imprinted and the stronger the contrast between the bevel and the background.
+     * Valid values are 0 to 255. A value of 0 means that the filter is not applied.
+     *
+     * @param quality The quality of the filter. Use BitmapFilterQuality constants:
+     *

+     *
BitmapFilterQuality.LOW

+     *
BitmapFilterQuality.MEDIUM

+     *
BitmapFilterQuality.HIGH

+     *

+     *
For more information, see the description of the quality property.

+     *
+     * @param type The placement of the bevel effect. Possible values are BitmapFilterType constants:
+     *

BitmapFilterType.OUTER — Bevel on the outer edge of the object

+     *
BitmapFilterType.INNER — Bevel on the inner edge of the object

+     *
BitmapFilterType.FULL — Bevel on top of the object

+     *

+     * @param knockout Specifies whether a knockout effect is applied. The value true
+     * makes the object's fill transparent and reveals the background color of the document.
+     *
+     * @langversion 3.0
+         * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @productversion Flex 4
+     *
+     */
+    public function GradientBevelFilter(distance:Number = 4.0, angle:Number = 45,
+                                        colors:Array = null, alphas:Array = null,
+                                        ratios:Array = null, blurX:Number = 4.0,
+                                        blurY:Number = 4.0, strength:Number = 1,
+                                        quality:int = 1, type:String = "inner",
+                                        knockout:Boolean = false)
+    {
+        super(colors, alphas, ratios);
+
+        this.distance = distance;
+        this.angle = angle;
+        this.blurX =blurX ;
+        this.blurY = blurY;
+        this.strength = strength;
+        this.quality = quality;
+        this.type = type;
+        this.knockout = knockout;
+    }
+
+    /**
+     * Returns a copy of this filter object.
+     * @return A new GradientBevelFilter instance with all the
+     * same properties as the original GradientBevelFilter instance.
+     *
+     * @langversion 3.0
+         * @playerversion Flash 10
+     * @playerversion AIR 1.5
+     * @productversion Flex 4
+     */
+    public function clone():BitmapFilter
+    {
+        return new flash.filters.GradientBevelFilter(distance, angle, colors, alphas, ratios,
+                                        blurX, blurY, strength, quality, type,
+                                        knockout);
+    }
+
 }
 }


CHANGED:EliteGeneration applied(TBC);

CHANGED:EliteGeneration applied(TBC);

--- src/com/suckatmath/machinelearning/genetic/core/GeneticEngine.as
+++ src/com/suckatmath/machinelearning/genetic/core/GeneticEngine.as
@@ -369,8 +369,31 @@
 		 * GA Pareto Elite Selection

 		 */
 		private function nextGenerationElite():void {
-			//TODO:sort population by elite
-			//
+			//sort population by fitness
+			population.sort(compareFitness);
+			trace("sorted pop: " + population.join("\n"),"length: ",population.length);
+			//remove bad chromosomes
+			const ELITE_SIZE:int = population.length * 0.1;
+			population.splice(ELITE_SIZE,population.length - ELITE_SIZE);
+			trace("Elite length and population :",population.length,population);
+			// shuffle chromosomes
+			var rand:Function = function():int
+			{
+				return Math.floor(Math.random() * population.length);
+			}
+
+			for ( var i:int = 0; i < ELITE_SIZE / 2; i++ )
+			{
+				var c1:int = rand();
+				var c2:int = rand();
+
+				// swap two chromosomes
+				var temp:Object = population[c1];
+				population[c1] = population[c2];
+				population[c2] = temp;
+			}
+			//TODO:recombination process.
+			var newPop:Array = population.concat();
 			/*
 			// sort chromosomes
 			chromosomes.Sort( );
@@ -393,7 +416,7 @@
 				}
 			}
 			*/
-//			replacePopulation(newPop);
+			replacePopulation(newPop);
 		}

 		/**


Show multiple attribute form item label when attribute is not inside table

--- collect-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
+++ collect-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
@@ -176,7 +176,7 @@
 				formItem = new CodeAttributeFormItem();
 			} else if(def.multiple) {
 				formItem = new MultipleAttributeFormItem();
-				MultipleAttributeFormItem(formItem).showLabel = false;
+				MultipleAttributeFormItem(formItem).showLabel = (parentLayout != UIUtil.LAYOUT_TABLE);
 			} else if(def is CoordinateAttributeDefinitionProxy || def is TaxonAttributeDefinitionProxy) {
 				formItem = new CompositeAttributeFormItem();
 			} else {


Исправление ошибки вычисления корня в Long

--- src/main/org/shypl/common/math/Long.as
+++ src/main/org/shypl/common/math/Long.as
@@ -464,6 +464,10 @@
 		}

 		public function sqrt():Long {
+			if (isZero() || isOne()) {
+				return this;
+			}
+
 			var p:Long = ONE;
 			while (p.compareTo(this.divide(p)) <= 0) {
 				p = p.shiftLeft(1);


Hide instead of skip UI element internal vars in AttributeEditor so that indexing works for user-added UI element variables (subindex 0 must always be found in current implementation.) Closes #1788.

--- bin/Data/Scripts/Editor/AttributeEditor.as
+++ bin/Data/Scripts/Editor/AttributeEditor.as
@@ -524,11 +524,13 @@
         for (uint i = 0; i < keys.length; ++i)
         {
             String varName = GetVarName(keys[i]);
+            bool shouldHide = false;
+
             if (varName.empty)
             {
-                // UIElements will contain internal vars, which do not have known mappings. Skip these
+                // UIElements will contain internal vars, which do not have known mappings. Hide these
                 if (cast<UIElement>(serializables[0]) !is null)
-                    continue;
+                    shouldHide = true;
                 // Else, for scene nodes, show as hexadecimal hashes if nothing else is available
                 varName = keys[i].ToString();
             }
@@ -544,7 +546,7 @@
             {
                 parent.vars["Key"] = keys[i].value;
                 // If variable name is not registered (i.e. it is an editor internal variable) then hide it
-                if (varName.empty)
+                if (varName.empty || shouldHide)
                     parent.visible = false;
             }
         }


Flash: There's no id field in Error class, it should be errorID.

--- src/flash/src/Moxie.as
+++ src/flash/src/Moxie.as
@@ -101,7 +101,7 @@
 				}

 			} catch(err:*) { // re-route exceptions thrown by components (TODO: check marshallExceptions feature)
-				_fireEvent(uid + "::Exception", { name: getQualifiedClassName(err).replace(/^[^:*]::/, ''), code: err.id });
+				_fireEvent(uid + "::Exception", { name: getQualifiedClassName(err).replace(/^[^:*]::/, ''), code: err.errorID });
 			}
 		}


Actually handle all the groups in iq:roster packets rather than just the first one. Also use for each to make one particularly nasty nested loop readable and faster

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

--- src/org/jivesoftware/xiff/im/Roster.as
+++ src/org/jivesoftware/xiff/im/Roster.as
@@ -383,26 +383,19 @@
 			removeAll();
 			try
 			{
-				var exts:Array = resultIQ.getAllExtensionsByNS( RosterExtension.NS );
-				var len:int = exts.length;
-				for (var x:int; x < len; x++){
-					var ext:RosterExtension = exts[x];
-					var newItems:Array = ext.getAllItems();
-					var eLen:int = newItems.length;
-					for( var i:int=0; i < eLen; i++ ) {
-						var item:* = newItems[ i ];
+				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){
-							var groups:Array = item.getGroups();
-							var gLen:int = groups.length;
-							if( gLen > 0 ){
-								for (var j:int=0; j < gLen;j++) {
-									addRosterItem( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline", item.getGroups()[j], item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );
-								}
-							}else{
-								addRosterItem( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline", "General", item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );
-							}
-						}
+						if (!item is XMLStanza)
+							continue;
+
+						var groups:Array = item.getGroups();
+						if(groups.length == 0)
+							groups = ["General"];
+
+						for each(var group:String in groups) {
+							addRosterItem( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline", group, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );
+						}
 					}
 				}

@@ -452,46 +445,49 @@
 					{
 						var tempIQ:IQ = eventObj.iq as IQ;
 						var ext:RosterExtension = tempIQ.getAllExtensionsByNS( RosterExtension.NS )[0] as RosterExtension;
-						var item:* = ext.getAllItems()[0];
-						var i:int = getContactIndex(item.jid);
-						var rosterItemVO:RosterItemVO = getContactInformation(item.jid.toLowerCase());
-						var ev: RosterEvent;
-
-						if (rosterItemVO != null)
+						for each(var item:* in ext.getAllItems())
 						{
-							switch (item.subscription.toLowerCase())
+							var i:int = getContactIndex(item.jid);
+							var rosterItemVO:RosterItemVO = getContactInformation(item.jid.toLowerCase());
+							var ev: RosterEvent;
+
+							if (rosterItemVO)
 							{
-								case RosterExtension.SUBSCRIBE_TYPE_NONE:
-									ev = new RosterEvent(RosterEvent.SUBSCRIPTION_REVOCATION);
-									ev.jid = item.jid;
-									dispatchEvent( ev );
-									break;
-								case RosterExtension.SUBSCRIBE_TYPE_REMOVE:
-									ev = new RosterEvent(RosterEvent.USER_REMOVED);
-									//TODO: is this the right thing to do here?
-									if(i < 0)
-										return; //couldn't find the contact
-									ev.data = removeItemAt(i);
-									ev.jid = item.jid;
-									dispatchEvent(ev);
-									break;
-
-								default:
-									updateRosterItemSubscription(i, item.subscription.toLowerCase(), item.name, item.getGroups()[0] );
-									break;
-							}
-
-
-
-
-						} else {
-							if( item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_REMOVE &&  item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_NONE) {
+								switch (item.subscription.toLowerCase())
+								{
+									case RosterExtension.SUBSCRIBE_TYPE_NONE:
+										ev = new RosterEvent(RosterEvent.SUBSCRIPTION_REVOCATION);
+										ev.jid = item.jid;
+										dispatchEvent( ev );
+										break;
+
+									case RosterExtension.SUBSCRIBE_TYPE_REMOVE:
+										//TODO: is this the right thing to do here?
+										if(i < 0)
+											return; //couldn't find the contact
+										ev = new RosterEvent(RosterEvent.USER_REMOVED);
+										ev.data = removeItemAt(i);
+										ev.jid = item.jid;
+										dispatchEvent(ev);
+										break;
+
+									default:
+										for each(var group:String in item.getGroups())
+										{
+											updateRosterItemSubscription(i, item.subscription.toLowerCase(), item.name, group );
+										}
+										break;
+								}
+							}
+							else if( item.subscription.toLowerCase() != RosterExtension.SUBSCRIBE_TYPE_REMOVE &&  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( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline", item.getGroups()[0], item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );
+								for each(var group:String in item.getGroups())
+								{
+									addRosterItem( item.jid, item.name, RosterExtension.SHOW_UNAVAILABLE, "Offline", group, item.subscription.toLowerCase(), item.askType != null ? item.askType.toLowerCase() : RosterExtension.ASK_TYPE_NONE );
+								}
 							}
 						}
-						return;
-
 					}
 					catch (e:Error)
 					{
@@ -504,7 +500,8 @@
 		private function handlePresence( aPresence:Presence ):void
 		{
 			// Handle based on the type of the presence received
-			aPresence.type = (aPresence.type == null)?(Presence.AVAILABLE_TYPE):(aPresence.type);
+			if(!aPresence.type)
+				aPresence.type = Presence.AVAILABLE_TYPE;
 			switch( aPresence.type.toLowerCase() )
 			{
 				case Presence.SUBSCRIBE_TYPE: