apply webstorm code formatting

apply webstorm code formatting

--- ShopbeamWidget.as
+++ ShopbeamWidget.as
@@ -1,132 +1,136 @@
 package {
-	import flash.system.*;
-	import flash.net.*;
-	import flash.external.*;
-	import flash.display.*;
-	import flash.events.*;
-	import fl.transitions.easing.*;
-	import fl.transitions.Tween;
-  import flash.globalization.CurrencyFormatter;

-	public class ShopbeamWidget extends MovieClip {
-		public function ShopbeamWidget() {
-      brandName.alpha = 0;
-      productName.alpha = 0;
-      listPrice.alpha = 0;
-      salePrice.alpha = 0;
-
-			var SHOP_HERE_TWEEN_X: int = 180;
-			var SHOP_HERE_INITIAL_X: int = hoverMovie.x;
-			var bagActive: Sprite = hoverMovie.bagActive;
-			var bagInactive: Sprite = hoverMovie.bagInactive;
-
-      function tweenTo(object: DisplayObject, property: String, value: *, duration: int = 30, durationInSeconds: Boolean = false): Tween {
-        return new Tween(object, property, Strong.easeOut, object[property], value, 30);
-      }
-
-      function tweenAlpha(object: DisplayObject, opacity: Number, duration: int = 30, durationInSeconds: Boolean = false): Tween {
-        return tweenTo(object, 'alpha', opacity, duration, durationInSeconds);
-      }
-
-      function fadeIn(object: DisplayObject, duration: int = 30, durationInSeconds: Boolean = false): void {
-        tweenAlpha(object, 1, duration, durationInSeconds)
-      }
-
-      function fadeOut(object: DisplayObject, duration: int = 30, durationInSeconds: Boolean = false): void {
-        tweenAlpha(object, 0, duration, durationInSeconds)
+import flash.system.*;
+import flash.net.*;
+import flash.external.*;
+import flash.display.*;
+import flash.events.*;
+
+import fl.transitions.easing.*;
+import fl.transitions.Tween;
+
+import flash.globalization.CurrencyFormatter;
+
+public class ShopbeamWidget extends MovieClip {
+  public function ShopbeamWidget() {
+    brandName.alpha = 0;
+    productName.alpha = 0;
+    listPrice.alpha = 0;
+    salePrice.alpha = 0;
+
+    var SHOP_HERE_TWEEN_X:int = 180;
+    var SHOP_HERE_INITIAL_X:int = hoverMovie.x;
+    var bagActive:Sprite = hoverMovie.bagActive;
+    var bagInactive:Sprite = hoverMovie.bagInactive;
+
+    function tweenTo(object:DisplayObject, property:String, value:*, duration:int = 30, durationInSeconds:Boolean = false):Tween {
+      return new Tween(object, property, Strong.easeOut, object[property], value, 30);
+    }
+
+    function tweenAlpha(object:DisplayObject, opacity:Number, duration:int = 30, durationInSeconds:Boolean = false):Tween {
+      return tweenTo(object, 'alpha', opacity, duration, durationInSeconds);
+    }
+
+    function fadeIn(object:DisplayObject, duration:int = 30, durationInSeconds:Boolean = false):void {
+      tweenAlpha(object, 1, duration, durationInSeconds)
+    }
+
+    function fadeOut(object:DisplayObject, duration:int = 30, durationInSeconds:Boolean = false):void {
+      tweenAlpha(object, 0, duration, durationInSeconds)
+    }
+
+    hoverArea.addEventListener(MouseEvent.MOUSE_OVER, function(event:MouseEvent):void {
+      fadeIn(listPrice);
+      if (listPrice.text !== salePrice.text) {
+        fadeIn(strikeThrough);
+        fadeIn(salePrice);
       }

-			hoverArea.addEventListener(MouseEvent.MOUSE_OVER, function(event:MouseEvent):void {
-        fadeIn(listPrice);
-        if (listPrice.text !== salePrice.text) {
-          fadeIn(strikeThrough);
-          fadeIn(salePrice);
-        }
-
-        fadeIn(brandName);
-        fadeIn(productName);
-        fadeIn(bagActive);
-        fadeOut(bagInactive);
-        tweenAlpha(backdrop, 0.6);
-        tweenTo(hoverMovie, 'x', SHOP_HERE_TWEEN_X);
-			});
+      fadeIn(brandName);
+      fadeIn(productName);
+      fadeIn(bagActive);
+      fadeOut(bagInactive);
+      tweenAlpha(backdrop, 0.6);
+      tweenTo(hoverMovie, 'x', SHOP_HERE_TWEEN_X);
+    });

-			hoverArea.addEventListener(MouseEvent.MOUSE_OUT, function(event:MouseEvent):void {
-        fadeOut(salePrice);
-        fadeOut(listPrice);
-        fadeOut(strikeThrough);
-
-        fadeOut(brandName);
-        fadeOut(productName);
-        fadeOut(bagActive);
-        fadeIn(bagInactive);
-        fadeOut(backdrop);
-        tweenTo(hoverMovie, 'x', SHOP_HERE_INITIAL_X);
-			});
-
-			function log(): void {
-				ExternalInterface.call('console.log', arguments.join(' '));
-			}
+    hoverArea.addEventListener(MouseEvent.MOUSE_OUT, function(event:MouseEvent):void {
+      fadeOut(salePrice);
+      fadeOut(listPrice);
+      fadeOut(strikeThrough);

-			function logError(): void {
-				ExternalInterface.call('console.error', arguments.join(' '));
-			}
+      fadeOut(brandName);
+      fadeOut(productName);
+      fadeOut(bagActive);
+      fadeIn(bagInactive);
+      fadeOut(backdrop);
+      tweenTo(hoverMovie, 'x', SHOP_HERE_INITIAL_X);
+    });

-			function executeJS(js): void {
-				var wrapped = 'try {\n' + js + '\n}catch(err){console.error(err);console.error(err.stack);}';
-				ExternalInterface.call('eval', wrapped);
-			}
+    function log():void {
+      ExternalInterface.call('console.log', arguments.join(' '));
+    }

-			Security.allowDomain('*');
+    function logError():void {
+      ExternalInterface.call('console.error', arguments.join(' '));
+    }

-			var widgetUuid: String = stage.loaderInfo.parameters.widgetUuid;
-			var loader: Loader = new Loader();
-			var widgetData: Object;
+    function executeJS(js):void {
+      var wrapped = 'try {\n' + js + '\n}catch(err){console.error(err);console.error(err.stack);}';
+      ExternalInterface.call('eval', wrapped);
+    }

-      ExternalInterface.addCallback('setWidgetData', function setWidgetData(data: String): void {
-        widgetData = JSON.parse(data);
-        brandName.text = widgetData.initialProduct.brandName;
-        productName.text = widgetData.initialProduct.name;
-
-        var dollarFormatter: CurrencyFormatter = new CurrencyFormatter('usd');
-        listPrice.text = dollarFormatter.format((widgetData.initialVariant.listPrice / 100), true);
-        //strikeThrough.width ...
-        salePrice.text = dollarFormatter.format((widgetData.initialVariant.salePrice / 100), true);
-      });
-
-			stage.align = StageAlign.TOP_LEFT;
-      stage.scaleMode = StageScaleMode.NO_SCALE;
-			var button: Sprite = new Sprite();
-      button.addChild(loader);
-
-      //required for `.useHandCursor` to work
-      hoverArea.buttonMode = true;
-      hoverArea.useHandCursor = true;
-      addChild(button);
-
-			setChildIndex(button, 0);
+    Security.allowDomain('*');

-			function loadingError(e: IOErrorEvent): void {
-				logError('widget with id: ' + widgetUuid + ' failed to load image');
-			}
+    var widgetUuid:String = stage.loaderInfo.parameters.widgetUuid;
+    var loader:Loader = new Loader();
+    var widgetData:Object;

-			loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadingError);
+    ExternalInterface.addCallback('setWidgetData', function setWidgetData(data:String):void {
+      widgetData = JSON.parse(data);
+      brandName.text = widgetData.initialProduct.brandName;
+      productName.text = widgetData.initialProduct.name;

-			function doneLoad(e: Event): void {
-				loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, doneLoad);
-				loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, loadingError);
-			}
-			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoad);
+      var dollarFormatter:CurrencyFormatter = new CurrencyFormatter('usd');
+      listPrice.text = dollarFormatter.format((widgetData.initialVariant.listPrice / 100), true);
+      //strikeThrough.width ...
+      salePrice.text = dollarFormatter.format((widgetData.initialVariant.salePrice / 100), true);
+    });

-			function loaderClickHandler(e: Event): void {
-				log('widgetOpenLightbox' + widgetUuid);
-				executeJS("Shopbeam.swfOpenLightbox('" + widgetUuid + "')");
-			}
+    stage.align = StageAlign.TOP_LEFT;
+    stage.scaleMode = StageScaleMode.NO_SCALE;
+    var button:Sprite = new Sprite();
+    button.addChild(loader);

-			hoverArea.addEventListener(MouseEvent.CLICK, loaderClickHandler);
+    //required for `.useHandCursor` to work
+    hoverArea.buttonMode = true;
+    hoverArea.useHandCursor = true;
+    addChild(button);

-			log('loading image: ' + stage.loaderInfo.parameters.imageUrl);
-			loader.load(new URLRequest(stage.loaderInfo.parameters.imageUrl));
-		}
-	}
+    setChildIndex(button, 0);
+
+    function loadingError(e:IOErrorEvent):void {
+      logError('widget with id: ' + widgetUuid + ' failed to load image');
+    }
+
+    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadingError);
+
+    function doneLoad(e:Event):void {
+      loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, doneLoad);
+      loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, loadingError);
+    }
+
+    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoad);
+
+    function loaderClickHandler(e:Event):void {
+      log('widgetOpenLightbox' + widgetUuid);
+      executeJS("Shopbeam.swfOpenLightbox('" + widgetUuid + "')");
+    }
+
+    hoverArea.addEventListener(MouseEvent.CLICK, loaderClickHandler);
+
+    log('loading image: ' + stage.loaderInfo.parameters.imageUrl);
+    loader.load(new URLRequest(stage.loaderInfo.parameters.imageUrl));
+  }
+}
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/airframework/src/mx/controls/HTML.as
+++ frameworks/projects/airframework/src/mx/controls/HTML.as
@@ -0,0 +1,1290 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controls
+{
+
+import flash.events.Event;
+import flash.events.HTMLUncaughtScriptExceptionEvent;
+import flash.events.MouseEvent;
+import flash.html.HTMLLoader;
+import flash.html.HTMLHistoryItem;
+import flash.html.HTMLHost;
+import flash.net.URLRequest;
+import flash.system.ApplicationDomain;
+import mx.controls.listClasses.BaseListData;
+import mx.controls.listClasses.IDropInListItemRenderer;
+import mx.controls.listClasses.IListItemRenderer;
+import mx.core.ClassFactory;
+import mx.core.EdgeMetrics;
+import mx.core.IDataRenderer;
+import mx.core.IFactory;
+import mx.core.FlexHTMLLoader;
+import mx.core.mx_internal;
+import mx.core.ScrollControlBase;
+import mx.core.ScrollPolicy;
+import mx.events.FlexEvent;
+import mx.events.ScrollEvent;
+import mx.styles.StyleManager
+import mx.styles.CSSStyleDeclaration;
+import mx.managers.IFocusManagerComponent;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched after the last loading operation caused by
+ *  setting the location or htmlText
+ *  property has completed.
+ *
+ *
This event is always dispatched asynchronously,
+ *  after the JavaScript "load" event
+ *  has been dispatched in the HTML DOM.

+ *
+ *
An event handler for this event may call any method
+ *  or access any property of this control
+ *  or its internal htmlLoader.

+ *
+ *  @eventType flash.events.Event.COMPLETE
+ *  @see location
+ *  @see htmlText
+ */
+[Event(name="complete", type="flash.events.Event")]
+
+/**
+ *  Dispatched after the HTML DOM has been initialized
+ *  in response to a loading operation caused by
+ *  setting the location or htmlText property.
+ *
+ *
When this event is dispatched,
+ *  no JavaScript methods have yet executed.
+ *  The domWindowand domWindow.document
+ *  objects exist, but other DOM objects may not.
+ *  You can use this event to set properties
+ *  onto the domWindow and domWindow.document
+ *  objects for JavaScript methods to later access.

+ *
+ *
A handler for this event should not set any properties
+ *  or call any methods which start another loading operation
+ *  or which affect the URL for the current loading operation;
+ *  doing so will cause either an ActionScript or a JavaScript exception.

+ *
+ *  @eventType flash.events.Event.HTML_DOM_INITIALIZE
+ *  @see location
+ *  @see htmlText
+ */
+[Event(name="htmlDOMInitialize", type="flash.events.Event")]
+
+/**
+ *  Dispatched when this control's HTML content initially renders,
+ *  and each time that it re-renders.
+ *
+ *
An HTML control can dispatch many of these events,
+ *  so minimize the amount of work you do
+ *  in a "render" handler.

+ *
+ *  @eventType flash.events.Event.HTML_RENDER
+ */
+[Event(name="htmlRender", type="flash.events.Event")]
+
+/**
+ *  Dispatched when the location property changes.
+ *
+ *
This event is always dispatched asynchronously.
+ *  An event handler for this event may call any method
+ *  or access any property of this control
+ *  or its internal htmlLoader.

+ *
+ *  @eventType flash.events.Event.LOCATION_CHANGE
+ */
+[Event(name="locationChange", type="flash.events.Event")]
+
+/**
+ *  Dispatched when an uncaught JavaScript exception occurs.
+ *
+ *
This event is always dispatched asynchronously.
+ *  An event handler for this event may call any method
+ *  or access any property of this control
+ *  or its internal htmlLoader.

+ *
+ *  @eventType flash.events.HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION
+ */
+[Event(name="uncaughtScriptException", type="flash.events.HTMLUncaughtScriptExceptionEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+/**
+ *  The number of pixels between the bottom edge of this control
+ *  and the bottom edge of its HTML content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The number of pixels between the left edge of this control
+ *  and the left edge of its HTML content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The number of pixels between the right edge of this control
+ *  and the right edge of its HTML content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingRight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  The number of pixels between the top edge of this control
+ *  and the top edge of its HTML content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[IconFile("HTML.png")]
+
+/**
+ *  The HTML control lets you display HTML content in your application.
+ *
+ *
You can use the location property to specify the URL
+ *  of an HTML page or the htmlText property to specify a String
+ *  containing HTML-formatted text.

+ */
+ public class HTML extends ScrollControlBase
+    implements IDataRenderer, IDropInListItemRenderer,
+    IListItemRenderer, IFocusManagerComponent
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static const MAX_HTML_WIDTH:Number = 2880;
+
+    /**
+     *  @private
+     */
+    private static const MAX_HTML_HEIGHT:Number = 2880;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  pdfCapability
+    //----------------------------------
+
+    /**
+     *  The type of PDF support on the user's system,
+     *  defined as an integer code value.
+     *
+     *
An HTML object can display PDF content only if this property
+     *  evaluates to PDFCapability.STATUS_OK.
+     *  The PDFCapability class defines constants for possible values
+     *  of the pdfCapability property, as follows:

+     *
+     *

+     *

+     *      PDFCapability constant
+     *      Meaning
+     *

+     *

+     *      STATUS_OK
+     *      A sufficient version (8.1 or later) of Acrobat Reader
+     *          is detected and PDF content can be loaded in an HTML object.
+     *
Note: On Windows, if a Acrobat Acrobat
+     *          or Acrobat Reader version 7.x or above
+     *      is currently running on the user's system,
+     *          that version is used even if a later version
+     *      that supports loading PDF loaded in an HTML object is installed.
+     *          In this case, if the the value of the
+     *          pdfCampability property is
+     *      PDFCapability.STATUS_OK,
+     *          when an AIR application attempts to load PDF content
+     *      into an HTML object, the older version of Acrobat or Reader
+     *          displays an alert, without an error message displayed the AIR runtime.
+     *          If this is a possible situation for your end users,
+     *          you may consider providing them with instructions to close Acrobat
+     *      while running your application.
+     *          You may consider displaying these instructions if the PDF
+     *      content does not load within an acceptable timeframe.

+     *

+     *

+     *      ERROR_INSTALLED_READER_NOT_FOUND
+     *      No version of Acrobat Reader is detected.
+     *          An HTML object cannot display PDF content.
+     *

+     *

+     *      ERROR_INSTALLED_READER_TOO_OLD
+     *      Acrobat Reader has been detected, but the version is too old.
+     *          An HTML object cannot display PDF content.
+     *

+     *

+     *      ERROR_PREFERED_READER_TOO_OLD
+     *      A sufficient version (8.1 or later) of Acrobat Reader is detected,
+     *          but the the version of Acrobat Reader that is setup
+     *          to handle PDF content is older than Reader 8.1.
+     *          An HTML object cannot display PDF content.
+     *

+     *

+     */
+    public static function get pdfCapability():int
+    {
+        return HTMLLoader.pdfCapability;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function HTML()
+    {
+        super();
+
+        mx_internal::_horizontalScrollPolicy = ScrollPolicy.AUTO;
+        mx_internal::_verticalScrollPolicy = ScrollPolicy.AUTO;
+
+		tabEnabled = false;
+		tabChildren = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Flag that will block default data/listData behavior.
+     */
+    private var textSet:Boolean;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set verticalScrollPosition(value:Number):void
+    {
+        // Clip the vertical scroll position to appropriate min/max bounds.
+        value = Math.max(value,0);
+        if (htmlLoader && (htmlLoader.contentHeight > htmlLoader.height))
+            value = Math.min(value,htmlLoader.contentHeight - htmlLoader.height)
+
+        super.verticalScrollPosition = value;
+
+        if (htmlLoader)
+            htmlLoader.scrollV = value;
+        else
+            invalidateProperties();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  contentHeight
+    //----------------------------------
+
+    /**
+     *  The height, in pixels, of the HTML content.
+     */
+    public function get contentHeight():Number
+    {
+        if (!htmlLoader)
+            return 0;
+
+        return htmlLoader.contentHeight;
+    }
+
+    //----------------------------------
+    //  contentWidth
+    //----------------------------------
+
+    /**
+     *  The width, in pixels, of the HTML content.
+     */
+    public function get contentWidth():Number
+    {
+        if (!htmlLoader)
+            return 0;
+
+        return htmlLoader.contentWidth;
+    }
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the data property.
+     */
+    private var _data:Object;
+
+    [Bindable("dataChange")]
+    [Inspectable(environment="none")]
+
+    /**
+     *  Lets you pass a value to the component
+     *  when you use it in an item renderer or item editor.
+     *  You typically use data binding to bind a field of the data
+     *  property to a property of this component.
+     *
+     *
When you use the control as a drop-in item renderer or drop-in
+     *  item editor, Flex automatically writes the current value of the item
+     *  to the text property of this control.

+     *
+     *
You cannot set this property in MXML.

+     *
+     *  @default null
+     *  @see mx.core.IDataRenderer
+     */
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    /**
+     *  @private
+     */
+    public function set data(value:Object):void
+    {
+        var newText:*;
+
+        _data = value;
+
+        if (_listData)
+        {
+            newText = _listData.label;
+        }
+        else if (_data != null)
+        {
+            if (_data is String)
+                newText = String(_data);
+            else
+                newText = _data.toString();
+        }
+
+        if (newText !== undefined && !textSet)
+        {
+            htmlText = newText;
+            textSet = false;
+        }
+
+        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+    }
+
+    //----------------------------------
+    //  historyLength
+    //----------------------------------
+
+    /**
+     *  The overall length of the history list,
+     *  including back and forward entries.
+     *
+     *  This property has the same value
+     *  as the window.history.length
+     *  JavaScript property of the the HTML content.
+     *
+     *  @see #historyPosition
+     */
+    public function get historyLength():int
+    {
+        if (!htmlLoader)
+            return 0;
+
+        return htmlLoader.historyLength;
+    }
+
+    //----------------------------------
+    //  historyPosition
+    //----------------------------------
+
+    /**
+     *  The current position in the history list.
+     *
+     *
The history list corresponds to the window.history
+     *  object of the HTML content.
+     *  Entries less than the current position are the "back" list;
+     *  entries greater are "forward."
+     *  Attempts to set the position beyond the end will set it to the end.

+     */
+    public function get historyPosition():int
+    {
+        if (!htmlLoader)
+            return 0;
+
+        return htmlLoader.historyPosition;
+    }
+
+    /**
+     *  @private
+     */
+    public function set historyPosition(value:int):void
+    {
+        if (htmlLoader)
+            htmlLoader.historyPosition = value;
+    }
+
+    //----------------------------------
+    //  htmlLoader
+    //----------------------------------
+
+    /**
+     *  The internal HTMLLoader object that renders
+     *  the HTML content for this control.
+     */
+    public var htmlLoader:HTMLLoader;
+
+    //----------------------------------
+    //  htmlLoaderFactory
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the htmlLoaderFactory property.
+     */
+    private var _htmlLoaderFactory:IFactory = new ClassFactory(FlexHTMLLoader);
+
+    [Bindable("htmlLoaderFactoryChanged")]
+
+    /**
+     *  The IFactory that creates an HTMLLoader-derived instance
+     *  to use as the htmlLoader.
+	 *
+     *
The default value is an IFactory for HTMLLoader.

+     */
+    public function get htmlLoaderFactory():IFactory
+    {
+        return _htmlLoaderFactory;
+    }
+
+    /**
+     *  @private
+     */
+    public function set htmlLoaderFactory(value:IFactory):void
+    {
+        _htmlLoaderFactory = value;
+
+		dispatchEvent(new Event("htmlLoaderFactoryChanged"));
+    }
+
+    //----------------------------------
+    //  htmlHost
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the htmlHost property.
+     */
+    private var _htmlHost:HTMLHost;
+
+    /**
+     *  @private
+     */
+    private var htmlHostChanged:Boolean = false;
+
+    /**
+     *  The HTMLHost object is used to handle changes
+     *  to certain user interface elements in the HTML content,
+     *  such as the window.document.title property.
+     *
+     *
To override default behaviors for the HTMLLoader,
+     *  create a subclass of the HTMLHost class,
+     *  override its member functions
+     *  to handle various user interface changes in the HTML content,
+     *  and set this property to an instance of your subclass.

+     *
+     *  @see flash.html.HTMLHost
+     */
+    public function get htmlHost():HTMLHost
+    {
+        return _htmlHost;
+    }
+
+    /**
+     *  @private
+     */
+    public function set htmlHost(value:HTMLHost):void
+    {
+        _htmlHost = value;
+        htmlHostChanged = true;
+
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  htmlText
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the htmlText property.
+     */
+    private var _htmlText:String;
+
+    /**
+     *  @private
+     */
+    private var htmlTextChanged:Boolean = false;
+
+    [Bindable("htmlTextChanged")]
+
+    /**
+     *  Specifies an HTML-formatted String for display by the control.
+     *
+     *
Setting this property has the side effect of setting
+     *  the location property to null,
+     *  and vice versa.

+     *
+     *  @default ""
+     *
+     *  @see #location
+     */
+    public function get htmlText():String
+    {
+        return _htmlText;
+    }
+
+    /**
+     *  @private
+     */
+    public function set htmlText(value:String):void
+    {
+        _htmlText = value;
+        htmlTextChanged = true;
+
+        // Setting both location and htmlText doesn't make sense,
+        // so setting one sets the other to null,
+        // and the last one set is applied in commitProperties().
+        _location = null;
+        locationChanged = false;
+
+        invalidateProperties();
+        invalidateSize();
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("htmlTextChanged"));
+    }
+
+    //----------------------------------
+    //  domWindow
+    //----------------------------------
+
+    /**
+     *  The JavaScript window object
+     *  for the root frame of the HTML DOM inside this control.
+     *
+     *
This property is null until the
+     *  htmlDOMInitialize event has been dispatched.

+     *
+     *  @default null
+     */
+    public function get domWindow():Object
+    {
+        if (!htmlLoader)
+            return null;
+
+        return htmlLoader.window;
+    }
+
+    //----------------------------------
+    //  listData
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the listData property.
+     */
+    private var _listData:BaseListData;
+
+    [Bindable("dataChange")]
+    [Inspectable(environment="none")]
+
+    /**
+     *  When a component is used as a drop-in item renderer or drop-in
+     *  item editor, Flex initializes the listData property
+     *  of the component with the appropriate data from the List control.
+     *  The component can then use the listData property
+     *  to initialize the data property of the drop-in
+     *  item renderer or drop-in item editor.
+     *
+     *
You do not set this property in MXML or ActionScript;
+     *  Flex sets it when the component is used as a drop-in item renderer
+     *  or drop-in item editor.

+     *
+     *  @default null
+     *  @see mx.controls.listClasses.IDropInListItemRenderer
+     */
+    public function get listData():BaseListData
+    {
+        return _listData;
+    }
+
+    /**
+     *  @private
+     */
+    public function set listData(value:BaseListData):void
+    {
+        _listData = value;
+    }
+
+    //----------------------------------
+    //  loaded
+    //----------------------------------
+
+    /**
+     *  A flag which indicates whether the JavaScript "load" event
+     *  corresponding to the previous loading operation
+     *  has been delivered to the HTML DOM in this control.
+     *
+     *
This property will be true
+     *  before the "complete" event is dispatched.

+     *
+     *
It is possible that this property
+     *  will never become true.
+     *  This happens in the same cases
+     *  in which the "complete" event is never dispatched.

+     *
+     *  @default false
+     */
+    public function get loaded():Boolean
+    {
+        if (!htmlLoader || locationChanged || htmlTextChanged)
+            return false;
+
+        return htmlLoader.loaded;
+    }
+
+    //----------------------------------
+    //  location
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the location property.
+     */
+    private var _location:String;
+
+    /**
+     *  @private
+     */
+    private var locationChanged:Boolean = false;
+
+    [Bindable("locationChange")]
+
+    /**
+     *  The URL of an HTML page to be displayed by this control.
+     *
+     *
Setting this property has the side effect of setting
+     *  the htmlText property to null,
+     *  and vice versa.

+     *
+     *  @default ""
+     *
+     *  @see #htmlText
+     */
+    public function get location():String
+    {
+        return _location;
+    }
+
+    /**
+     *  @private
+     */
+    public function set location(value:String):void
+    {
+        _location = value;
+        locationChanged = true;
+
+        // Setting both location and htmlText doesn't make sense,
+        // so setting one sets the other to null,
+        // and the last one set is applied in commitProperties().
+        _htmlText = null;
+        htmlTextChanged = false;
+
+        invalidateProperties();
+        invalidateSize();
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("locationChange"));
+    }
+
+    //----------------------------------
+    //  paintsDefaultBackground
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the paintsDefaultBackground property.
+     */
+    private var _paintsDefaultBackground:Boolean;
+
+    /**
+     *  @private
+     */
+    private var paintsDefaultBackgroundChanged:Boolean = false;
+
+    /**
+     *  Whether this control's HTML content
+     *  has a default opaque white background or not.
+     *
+     *
If this property is false,
+     *  then the background specified for this Flex control, if any,
+     *  appears behind the HTML content.

+     *
+     *
However, if any HTML element has its own opaque background color
+     *  (specified by style="background-color:gray", for instance),
+     *  then that background will appear behind that element.

+     */
+    public function get paintsDefaultBackground():Boolean
+    {
+        return _paintsDefaultBackground;
+    }
+
+    /**
+     *  @private
+     */
+    public function set paintsDefaultBackground(value:Boolean):void
+    {
+        _paintsDefaultBackground = value;
+        paintsDefaultBackgroundChanged = true;
+
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  runtimeApplicationDomain
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the runtimeApplicationDomain property.
+     */
+    private var _runtimeApplicationDomain:ApplicationDomain;
+
+    /**
+     *  @private
+     */
+    private var runtimeApplicationDomainChanged:Boolean = false;
+
+    /**
+     *  The ApplicationDomain to use for HTML's window.runtime
+     *  scripting.
+     *
+     *
If this property is null, or if it specifies
+     *  an ApplicationDomain from a different security domain
+     *  than the HTML content, the HTML page will use a default
+     *  ApplicationDomain for the page's domain.

+     *
+     *  @default null
+     */
+    public function get runtimeApplicationDomain():ApplicationDomain
+    {
+        return _runtimeApplicationDomain;
+    }
+
+    /**
+     *  @private
+     */
+    public function set runtimeApplicationDomain(value:ApplicationDomain):void
+    {
+        _runtimeApplicationDomain = value;
+        runtimeApplicationDomainChanged = true;
+
+        invalidateProperties();
+    }
+
+    //----------------------------------
+    //  userAgent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the userAgent property.
+     */
+    private var _userAgent:String;
+
+    /**
+     *  @private
+     */
+    private var userAgentChanged:Boolean = false;
+
+    /**
+     *  The user agent string to be used in content requests
+     *  from this control.
+     *
+     *
You can set the default user agent string used by all
+     *  HTML controls in an application domain by setting the
+     *  static URLRequestDefaults.userAgent property.
+     *  If no value is set for the userAgent property
+     *  (or if the value is set to null),
+     *  the user agent string is set to the value of
+     *  URLRequestDefaults.userAgent.

+     *
+     *
If neither the userAgent property
+     *  of this control nor for URLRequestDefaults.userAgent,
+     *  has a value set, a default value is used as the user agent string.
+     *  This default value varies depending on the runtime
+     *  operating system (such as Mac OS or Windows),
+     *  the runtime language, and the runtime version,
+     *  as in the following two examples:

+     *
+     *

+     *  "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0"
+     *  "Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) AdobeAIR/1.0"
+     *

+     *
+     *  @default null
+     *
+     *  @see flash.net.URLRequest#userAgent
+     *  @see flash.net.URLRequestDefaults#userAgent
+     */
+    public function get userAgent():String
+    {
+        return _userAgent;
+    }
+
+    /**
+     *  @private
+     */
+    public function set userAgent(value:String):void
+    {
+        _userAgent = value;
+        userAgentChanged = true;
+
+        invalidateProperties();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        if (!htmlLoader)
+        {
+            htmlLoader = htmlLoaderFactory.newInstance();
+
+            htmlLoader.addEventListener(
+                Event.HTML_DOM_INITIALIZE, htmlLoader_domInitialize);
+
+            htmlLoader.addEventListener(
+                Event.COMPLETE, htmlLoader_completeHandler);
+
+            htmlLoader.addEventListener(
+                Event.HTML_RENDER, htmlLoader_htmlRenderHandler);
+
+             htmlLoader.addEventListener(
+                Event.LOCATION_CHANGE, htmlLoader_locationChangeHandler);
+
+            htmlLoader.addEventListener(
+                Event.HTML_BOUNDS_CHANGE, htmlLoader_htmlBoundsChangeHandler);
+
+            htmlLoader.addEventListener(
+                Event.SCROLL, htmlLoader_scrollHandler);
+
+            htmlLoader.addEventListener(
+                HTMLUncaughtScriptExceptionEvent.UNCAUGHT_SCRIPT_EXCEPTION,
+                htmlLoader_uncaughtScriptExceptionHandler);
+
+            addChild(htmlLoader);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // Change the properties of the HTMLLoader
+        // before calling its load() or loadString() method.
+
+        if (htmlHostChanged)
+        {
+            htmlLoader.htmlHost = _htmlHost;
+            htmlHostChanged = false;
+        }
+
+        if (paintsDefaultBackgroundChanged)
+        {
+            htmlLoader.paintsDefaultBackground = _paintsDefaultBackground;
+            paintsDefaultBackgroundChanged = false;
+        }
+
+        if (runtimeApplicationDomainChanged)
+        {
+            htmlLoader.runtimeApplicationDomain = _runtimeApplicationDomain;
+            runtimeApplicationDomainChanged = false;
+        }
+
+        if (userAgentChanged)
+        {
+            htmlLoader.userAgent = _userAgent;
+            userAgentChanged = false;
+        }
+
+        if (locationChanged)
+        {
+            htmlLoader.load(new URLRequest(_location));
+            locationChanged = false;
+        }
+
+        if (htmlTextChanged)
+        {
+            htmlLoader.loadString(_htmlText);
+            htmlTextChanged = false;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        var em:EdgeMetrics = viewMetrics;
+
+        em.left += getStyle("paddingLeft");
+        em.top += getStyle("paddingTop");
+        em.right += getStyle("paddingRight");
+        em.bottom += getStyle("paddingBottom");
+
+        measuredWidth = Math.min(htmlLoader.contentWidth + em.left + em.right,
+                                 MAX_HTML_WIDTH);
+        measuredHeight = Math.min(htmlLoader.contentHeight + em.top + em.bottom,
+                                  MAX_HTML_HEIGHT);
+
+        //trace("measure", htmlLoader.contentWidth, htmlLoader.contentHeight, measuredWidth, measuredHeight);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var em:EdgeMetrics = viewMetrics;
+
+        em.left += getStyle("paddingLeft");
+        em.top += getStyle("paddingTop");
+        em.right += getStyle("paddingRight");
+        em.bottom += getStyle("paddingBottom");
+
+        htmlLoader.x = em.left;
+        htmlLoader.y = em.top;
+
+        // The width and height of an HTMLLoader can't be 0.
+        var w:Number = Math.max(unscaledWidth - em.left - em.right, 1);
+        var h:Number = Math.max(unscaledHeight - em.top - em.bottom, 1);
+
+        htmlLoader.width = w;
+        htmlLoader.height = h;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Cancels any load operation in progress.
+     *
+     *
This method does nothing if it is called before this component's
+     *  internal HTMLLoader (the htmlLoader property) has been created.

+     */
+    public function cancelLoad():void
+    {
+        if (htmlLoader)
+            htmlLoader.cancelLoad();
+    }
+
+    /**
+     *  Returns the HTMLHistoryItem at the specified position
+     *  in this control's history list.
+     *
+     *
This method returns null if it is called before this
+     *  component's internal HTMLLoader (the htmlLoader property) has been created.

+     *
+     *  @param position The position in the history list.
+     *
+     *  @return A HTMLHistoryItem object
+     *  for the history entry  at the specified position.
+     *
+     *  @see historyPosition
+     */
+    public function getHistoryAt(position:int):HTMLHistoryItem
+    {
+        if (!htmlLoader)
+            return null;
+
+        return htmlLoader.getHistoryAt(position);
+    }
+
+    /**
+     *  Navigates back in this control's history list, if possible.
+     *
+     *
Calling this method of the HTMLLoader object
+     *  has the same effect as calling the back() method
+     *  of the window.history property in JavaScript
+     *  in the HTML content.

+     *
+     *
This method does nothing if it is called before this component's
+     *  internal HTMLLoader (the htmlLoader property) has been created.

+     *
+     *  @see #historyPosition
+     *  @see #historyForward()
+     */
+    public function historyBack():void
+    {
+        if (htmlLoader)
+            htmlLoader.historyBack();
+    }
+
+    /**
+     *  Navigates forward in this control's history list, if possible.
+     *
+     *
Calling this method of the HTMLLoader object
+     *  has the same effect as calling the forward() method
+     *  of the window.history property in JavaScript
+     *  in the HTML content.

+     *
+     *
This function throws no errors.

+     *
+     *
This method does nothing if it is called before this component's
+     *  internal HTMLLoader (the htmlLoader property) has been created.

+     *
+     *  @see #historyPosition
+     *  @see #historyBack()
+     */
+    public function historyForward():void
+    {
+        if (htmlLoader)
+            htmlLoader.historyForward();
+    }
+
+    /**
+     *  Navigates the specified number of steps in this control's history list.
+     *
+     *
This method navigates forward if the number of steps
+     *  is positive and backward if it is negative.
+     *  Navigation by zero steps is equivalent
+     *  to calling reload().

+     *
+     *
This method is equivalent to calling the go() method
+     *  of the window.history property in JavaScript
+     *  in the HTML content.

+     *
+     *
This function throws no errors.

+     *
+     *
This method does nothing if it is called before this component's
+     *  internal HTMLLoader (the htmlLoader property) has been created.

+     *
+     *  @param steps The number of steps in the history list
+     *  to move forward (positive) or backward (negative).
+     */
+    public function historyGo(steps:int):void
+    {
+        if (htmlLoader)
+            htmlLoader.historyGo(steps);
+    }
+
+    /**
+     *  Reloads the HTML content from the current location.
+     *
+     *
This method does nothing if it is called before this component's
+     *  internal HTMLLoader (the htmlLoader property) has been created.

+     */
+    public function reload():void
+    {
+        if (htmlLoader)
+            htmlLoader.reload();
+    }
+
+    /**
+     *  @private
+     */
+    private function adjustScrollBars():void
+    {
+        setScrollBarProperties(htmlLoader.contentWidth, htmlLoader.width,
+                               htmlLoader.contentHeight, htmlLoader.height);
+
+        // This is a temporary solution for adjusting the speed of scrolling
+        // via scrollbar arrows. There isn't a lot of overhead here, but
+        // we still shouldn't have to set these values every time
+        // updateDisplayList() is called.
+        if (verticalScrollBar)
+            verticalScrollBar.lineScrollSize = 20;
+        if (horizontalScrollBar)
+            horizontalScrollBar.lineScrollSize = 20;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: ScrollControlBase
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function scrollHandler(event:Event):void
+    {
+        super.scrollHandler(event);
+
+        htmlLoader.scrollH = horizontalScrollPosition;
+        htmlLoader.scrollV = verticalScrollPosition;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function mouseWheelHandler(event:MouseEvent):void
+    {
+    	// Ignore mouseWheel events that are bubbling up
+    	// from the HTMLLoader; they have already been handled there.
+    	if (event.target != this)
+    		return;
+
+        // Magnify the scrolling to approximate what browsers do.
+        event.delta *= 6;
+
+        super.mouseWheelHandler(event);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_domInitialize(event:Event):void
+    {
+         dispatchEvent(event);
+    }
+
+    /*
+     *  @private
+     */
+    private function htmlLoader_completeHandler(event:Event):void
+    {
+         invalidateSize();
+
+         dispatchEvent(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_htmlRenderHandler(event:Event):void
+    {
+        dispatchEvent(event);
+
+        adjustScrollBars();
+    }
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_locationChangeHandler(event:Event):void
+    {
+        var change:Boolean = _location != htmlLoader.location;
+
+        _location = htmlLoader.location;
+
+        if (change)
+            dispatchEvent(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_htmlBoundsChangeHandler(event:Event):void
+    {
+        invalidateSize();
+
+        adjustScrollBars();
+    }
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_scrollHandler(event:Event):void
+    {
+    	horizontalScrollPosition = htmlLoader.scrollH;
+        verticalScrollPosition = htmlLoader.scrollV;
+    }
+
+    /**
+     *  @private
+     */
+    private function htmlLoader_uncaughtScriptExceptionHandler(
+                            event:HTMLUncaughtScriptExceptionEvent):void
+    {
+        var clonedEvent:Event = event.clone();
+
+        dispatchEvent(clonedEvent);
+
+        if (clonedEvent.isDefaultPrevented())
+            event.preventDefault();
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.charts
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5383
Author:   jimurphy@adobe.com
Date:     2009-03-18T13:08:33.865663Z

Log Message:
-----------
Merge 3.x revisions 5326-5327,5329,5343 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>

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

--- frameworks/projects/framework/src/mx/utils/ObjectUtil.as
+++ frameworks/projects/framework/src/mx/utils/ObjectUtil.as
@@ -1272,6 +1272,10 @@
     private static function byteArrayCompare(a:ByteArray, b:ByteArray):int
     {
         var result:int = 0;
+
+        if (a == b)
+            return result;
+
         if (a.length != b.length)
         {
             if (a.length < b.length)
@@ -1281,11 +1285,9 @@
         }
         else
         {
-            a.position = 0;
-            b.position = 0;
             for (var i:int = 0; i < a.length; i++)
             {
-                result = numericCompare(a.readByte(), b.readByte());
+                result = numericCompare(a[i], b[i]);
                 if (result != 0)
                 {
                     i = a.length;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8386
Author:   srahim@adobe.com
Date:     2009-07-06T19:50:00.014831Z

Log Message:
-----------
ASDoc updates for Spark components

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.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/spark/src/spark/components/TextInput.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/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>

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

--- frameworks/projects/spark/src/spark/components/Button.as
+++ frameworks/projects/spark/src/spark/components/Button.as
@@ -35,6 +35,26 @@
  *  mouseOver, mouseOut, rollOver,
  *  rollOut, mouseDown, and
  *  mouseUp events whether enabled or disabled.

+ *
+ *
The Button control has the following default characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           Default size
+ *           Wide enough to display the text label of the control
+ *

+ *

+ *           Minimum size
+ *           21 pixels wide and 21 pixels high
+ *

+ *

+ *           Maximum size
+ *           10000 pixels wide and 10000 pixels high
+ *

+ *

  *
  *  @mxml
The <Button> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:


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

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

 package spark.components
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 3270
Author:   hmuller@adobe.com
Date:     2008-09-19T14:38:31.675747Z

Log Message:
-----------
Added row/column visibility tracking to Vertical,HorizontalLayout.
This is an incremental change aimed at enabling step/page scrolling
and animated scrolling.

Added new bindable read-only properties firstIndexInView and
lastIndexInView to VerticalLayout.  They track the first/last row
that's within the layout target's scrollRect and included in the
layout.  Note that any other row within this range may not actually be
"in view" (or visible) because its item could be null or
includeInLayout=false, or have height=0, etc.

Exposed these properties on VGroup.

Added a VerticalLayout method called inView that reports if a
particular row is "in view" or partially so.

Made comparable changes to HorizontalLayout, HGroup.

QE: No
Doc: No
Checkintests: Pass
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/HGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/VGroup.as
+++ frameworks/projects/spark/src/spark/components/VGroup.as
@@ -14,6 +14,7 @@
 import flex.core.Group;
 import flex.intf.ILayout;
 import flex.layout.VerticalLayout;
+import flash.events.Event;

 /**
  *  A Group with a VerticalLayout.
@@ -144,6 +145,30 @@
     {
         verticalLayout.variableRowHeight = value;
     }
+
+    //----------------------------------
+    //  firstIndexInView
+    //----------------------------------
+
+    /**
+     * @copy flex.layout.VerticalLayout#firstIndexInView
+     */
+    public function get firstIndexInView():int
+    {
+        return verticalLayout.firstIndexInView;
+    }
+
+    //----------------------------------
+    //  lastIndexInView
+    //----------------------------------

+    /**
+     * @copy flex.layout.VerticalLayout#lastIndexInview
+     */
+    public function get lastIndexInView():int
+    {
+        return verticalLayout.lastIndexInView;
+    }
+
 }
 }


avoiding infinite update loop

avoiding infinite update loop

Change-Id: I2506861e56f295066caa14c1d1f52d87373509bc

--- WeaveUI/src/weave/ui/CustomTree.as
+++ WeaveUI/src/weave/ui/CustomTree.as
@@ -125,7 +125,8 @@
 			if (maxHSP <= 0)
 			{
 				maxHSP = 0;
-				horizontalScrollPosition = 0;
+				if (horizontalScrollPosition != 0)
+					horizontalScrollPosition = 0;

 				// horizontal scroll is kept on except when there is no vertical scroll
 				// this avoids an infinite hide/show loop where hiding/showing the h-scroll bar affects the max h-scroll value


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19320
Author:   cframpto@adobe.com
Date:     2010-12-13T19:41:10.007646Z

Log Message:
-----------
Add style metadata for iconPlacement with theme="mobile" since spark RadioButton and CheckBox do not support iconPlacement.  ButtonBase has style metadata for iconPlacement with theme="spark,mobile".  Should consider supporting this feature for the next release.

QE notes:
Doc notes:
Bugs: SDK-27920
Reviewer: Darrell
Tests run: RadioButton, CheckBox
Is noteworthy for integration:

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

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

--- frameworks/projects/spark/src/spark/components/CheckBox.as
+++ frameworks/projects/spark/src/spark/components/CheckBox.as
@@ -24,6 +24,27 @@
 //--------------------------------------
 //  Styles
 //--------------------------------------
+
+/**
+ *  Orientation of the icon in relation to the label.
+ *  Valid MXML values are right, left,
+ *  bottom, and top.
+ *
+ *
In ActionScript, you can use the following constants
+ *  to set this property:
+ *  IconPlacement.RIGHT,
+ *  IconPlacement.LEFT,
+ *  IconPlacement.BOTTOM, and
+ *  IconPlacement.TOP.

+ *
+ *  @default IconPlacement.LEFT
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="iconPlacement", type="String", enumeration="top,bottom,right,left", inherit="no", theme="mobile")]

 /**
  *  @copy spark.components.supportClasses.GroupBase#style:symbolColor


Transferred from the Adobe Open Source Subversion Repository

Revision: 22211
Author:   eday@adobe.com
Date:     2011-08-25T17:29:02.272661Z

Log Message:
-----------
Reverting 22197 due to mustella failures

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

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -619,9 +619,9 @@
      */
     mx_internal function set pullEnabled(value:Boolean):void
     {
-        if (_pullEnabled == value)
-            return;
-
+		if (_pullEnabled == value)
+			return;
+
         _pullEnabled = value;
         scrollRangesChanged = true;
         invalidateProperties();
@@ -645,9 +645,9 @@
      */
     mx_internal function set bounceEnabled(value:Boolean):void
     {
-        if (_bounceEnabled == value)
-            return;
-
+		if (_bounceEnabled == value)
+			return;
+
         _bounceEnabled = value;
         scrollRangesChanged = true;
         invalidateProperties();
@@ -879,7 +879,7 @@
      *  horizontalScrollBar skin part to that instance.
      *
      *  This property should be considered read-only. It is only
-     *  set by the Scroller's skin.
+     *  set by the Scroller's skin.
      *  To access the HScrollBar instance, use horizontalScrollBar.
      */
     public var horizontalScrollBarFactory:IFactory;
@@ -1077,7 +1077,6 @@
             viewport.clipAndEnableScrolling = true;
             Group(skin).addElementAt(viewport, 0);
             viewport.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
-            viewport.addEventListener(Event.RESIZE, viewport_resizeHandler);
         }
         if (verticalScrollBar)
             verticalScrollBar.viewport = viewport;
@@ -1096,7 +1095,6 @@
             viewport.clipAndEnableScrolling = false;
             Group(skin).removeElement(viewport);
             viewport.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
-            viewport.removeEventListener(Event.RESIZE, viewport_resizeHandler);
         }
     }

@@ -1473,10 +1471,10 @@
         else if (canScrollVertically)
             scrollProperty = VERTICAL_SCROLL_POSITION;

-        // If there's an animation playing, we need
-        // to stop it before we snap the element into
-        // position.
-        stopAnimations();
+        // If there's an animation playing, we need
+        // to stop it before we snap the element into
+        // position.
+        stopAnimations();

         if (animate)
         {
@@ -1489,27 +1487,27 @@
             var snapMotionPath:Vector.<MotionPath> = Vector.<MotionPath>([new SimpleMotionPath(scrollProperty, null, snapScrollPosition)]);
             snapElementAnimation.motionPaths = snapMotionPath;
             snapElementAnimation.play();
-
-            return snapElementAnimation;
+
+			return snapElementAnimation;
         }
         else
         {
             viewport[scrollProperty] = snapScrollPosition;
-
-            return null;
-        }
-    }
-
-    /**
-     *  @private
-     */
-    private function stopAnimations():void
-    {
-        if (throwEffect && throwEffect.isPlaying)
-            throwEffect.stop();
-        if (snapElementAnimation && snapElementAnimation.isPlaying)
-            snapElementAnimation.stop();
-    }
+
+			return null;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function stopAnimations():void
+    {
+        if (throwEffect && throwEffect.isPlaying)
+            throwEffect.stop();
+        if (snapElementAnimation && snapElementAnimation.isPlaying)
+            snapElementAnimation.stop();
+    }

     //--------------------------------------------------------------------------
     //
@@ -1910,22 +1908,6 @@
     /**
      *  @private
      */
-    private function viewport_resizeHandler(event:Event):void
-    {
-        if (getStyle("interactionMode") == InteractionMode.TOUCH)
-        {
-            // If the viewport dimensions have changed, then we may need to update the
-            // scroll ranges and positions per the new viewport size.
-            // Note that the orientationChangeHandler serves the same purpose, but on
-            // some platforms (i.e. Android) the runtime sends the "orientationChange"
-            // event before the new viewport dimensions are set.
-            checkScrollPosition();
-        }
-    }
-
-    /**
-     *  @private
-     */
     private function viewport_propertyChangeHandler(event:PropertyChangeEvent):void
     {
         switch(event.property)
@@ -2294,7 +2276,7 @@
     //  Touch scrolling methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      *  Add touch listeners
@@ -2629,11 +2611,11 @@
             {
                 installTouchListeners();

-                // Need to make sure the scroll ranges are updated now, since they may
-                // not have been if the scroller was in non-touch mode when the content
-                // was created/changed.
-                scrollRangesChanged = true;
-                invalidateProperties();
+                // Need to make sure the scroll ranges are updated now, since they may
+                // not have been if the scroller was in non-touch mode when the content
+                // was created/changed.
+                scrollRangesChanged = true;
+                invalidateProperties();

                 if (!touchScrollHelper)
                 {
@@ -3123,11 +3105,11 @@
     {
         stopThrowEffectOnMouseDown();

-        // If the snap animation is playing, we need to stop it
-        // before watching for a scroll and potentially beginning
+        // If the snap animation is playing, we need to stop it
+        // before watching for a scroll and potentially beginning
         // a new touch interaction.
-        if (snapElementAnimation && snapElementAnimation.isPlaying)
-            snapElementAnimation.stop();
+        if (snapElementAnimation && snapElementAnimation.isPlaying)
+            snapElementAnimation.stop();

         captureNextClick = false;

@@ -3140,7 +3122,7 @@
             Math.round(minSlopInches * Capabilities.screenDPI),
             dragEventThinning ? MAX_DRAG_RATE : NaN);
     }
-
+
     /**
      *  @private
      */
@@ -3163,7 +3145,7 @@

         var xMove:int = 0;
         var yMove:int = 0;
-
+
         if (canScrollHorizontally)
             xMove = dragX;

@@ -3196,7 +3178,7 @@
             newHSP = Math.min(Math.max(newHSP, -viewportWidth), maxHorizontalScrollPosition+viewportWidth);
             newVSP = Math.min(Math.max(newVSP, -viewportHeight), maxVerticalScrollPosition+viewportHeight);
         }
-
+
         viewport.horizontalScrollPosition = newHSP;
         viewport.verticalScrollPosition = newVSP;
     }
@@ -3301,141 +3283,141 @@
         // scrollbars in overlay mode
         skin.invalidateDisplayList();
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Text selection auto scroll
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  When true, use the text selection scroll behavior instead of the
-     *  typical "throw" behavior. This is only used when interactionMode="touch"
-     */
-    mx_internal var textSelectionAutoScrollEnabled:Boolean = false;
-    private var textSelectionAutoScrollTimer:Timer;
-    private var minTextSelectionVScrollPos:int = 0;
-    private var maxTextSelectionVScrollPos:int = -1;
-    private var minTextSelectionHScrollPos:int = 0;
-    private var maxTextSelectionHScrollPos:int = -1;
-    private static const TEXT_SELECTION_AUTO_SCROLL_FPS:int = 10;
-
-    /**
-     *  @private
-     *  Change scroll behavior when selecting text.
-     */
-    mx_internal function enableTextSelectionAutoScroll(enable:Boolean,
-                       minHScrollPosition:int = 0, maxHScrollPosition:int = -1,
-                       minVScrollPosition:int = 0, maxVScrollPosition:int = -1):void
-    {
-        if (getStyle("interactionMode") == InteractionMode.TOUCH)
-        {
-            this.textSelectionAutoScrollEnabled = enable;
-            this.minTextSelectionHScrollPos = minHScrollPosition;
-            this.maxTextSelectionHScrollPos = maxHScrollPosition;
-            this.minTextSelectionVScrollPos = minVScrollPosition;
-            this.maxTextSelectionVScrollPos = maxVScrollPosition;
-        }
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal function setUpTextSelectionAutoScroll():void
-    {
-        if (!textSelectionAutoScrollTimer)
-        {
-            textSelectionAutoScrollTimer = new Timer(1000 / TEXT_SELECTION_AUTO_SCROLL_FPS);
-            textSelectionAutoScrollTimer.addEventListener(TimerEvent.TIMER,
-                textSelectionAutoScrollTimerHandler);
-
-            textSelectionAutoScrollTimer.start();
-        }
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal function stopTextSelectionAutoScroll():void
-    {
-        if (textSelectionAutoScrollTimer)
-        {
-            textSelectionAutoScrollTimer.stop();
-            textSelectionAutoScrollTimer.removeEventListener(TimerEvent.TIMER,
-                textSelectionAutoScrollTimerHandler);
-            textSelectionAutoScrollTimer = null;
-        }
-    }
-
-    /**
-     *  @private
-     */
-    private function textSelectionAutoScrollTimerHandler(event:TimerEvent):void
-    {
-        const SLOW_SCROLL_THRESHOLD:int = 12;       // Distance from edge to trigger a slow scroll
-        const SLOW_SCROLL_SPEED:int = 20;           // Pixels per timer callback to scroll
-        const FAST_SCROLL_THRESHOLD:int = 3;        // Distance from edge to trigger a fast scroll
-        const FAST_SCROLL_DELTA:int = 30;           // Added to SLOW_SCROLL_SPEED to determine fast speed
-
-        var newVSP:Number = viewport.verticalScrollPosition;
-        var newHSP:Number = viewport.horizontalScrollPosition;
-
-        if (canScrollHorizontally)
-        {
-            if (mouseX > width - SLOW_SCROLL_THRESHOLD)
-            {
-                newHSP += SLOW_SCROLL_SPEED;
-
-                if (mouseX > width - FAST_SCROLL_THRESHOLD)
-                    newHSP += FAST_SCROLL_DELTA;
-
-                if (maxTextSelectionHScrollPos != -1 && newHSP > maxTextSelectionHScrollPos)
-                    newHSP = maxTextSelectionHScrollPos;
-            }
-
-            if (mouseX < SLOW_SCROLL_THRESHOLD)
-            {
-                newHSP -= SLOW_SCROLL_SPEED;
-
-                if (mouseX < FAST_SCROLL_THRESHOLD)
-                    newHSP -= FAST_SCROLL_DELTA;
-
-                if (newHSP < minTextSelectionHScrollPos)
-                    newHSP = minTextSelectionHScrollPos;
-            }
-        }
-
-        if (canScrollVertically)
-        {
-            if (mouseY > height - SLOW_SCROLL_THRESHOLD)
-            {
-                newVSP += SLOW_SCROLL_SPEED;
-
-                if (mouseY > height - FAST_SCROLL_THRESHOLD)
-                    newVSP += FAST_SCROLL_DELTA;
-
-                if (maxTextSelectionVScrollPos != -1 && newVSP > maxTextSelectionVScrollPos)
-                    newVSP = maxTextSelectionVScrollPos;
-            }
-
-            if (mouseY < SLOW_SCROLL_THRESHOLD)
-            {
-                newVSP -= SLOW_SCROLL_SPEED;
-
-                if (mouseY < FAST_SCROLL_THRESHOLD)
-                    newVSP -= FAST_SCROLL_DELTA;
-
-                if (newVSP < minTextSelectionVScrollPos)
-                    newVSP = minTextSelectionVScrollPos;
-            }
-        }
-
-        if (newHSP != viewport.horizontalScrollPosition)
-            viewport.horizontalScrollPosition = newHSP;
-        if (newVSP != viewport.verticalScrollPosition)
-            viewport.verticalScrollPosition = newVSP;
-    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Text selection auto scroll
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  When true, use the text selection scroll behavior instead of the
+	 *  typical "throw" behavior. This is only used when interactionMode="touch"
+	 */
+	mx_internal var textSelectionAutoScrollEnabled:Boolean = false;
+	private var textSelectionAutoScrollTimer:Timer;
+	private var minTextSelectionVScrollPos:int = 0;
+	private var maxTextSelectionVScrollPos:int = -1;
+	private var minTextSelectionHScrollPos:int = 0;
+	private var maxTextSelectionHScrollPos:int = -1;
+	private static const TEXT_SELECTION_AUTO_SCROLL_FPS:int = 10;
+
+	/**
+	 *  @private
+	 *  Change scroll behavior when selecting text.
+	 */
+	mx_internal function enableTextSelectionAutoScroll(enable:Boolean,
+					   minHScrollPosition:int = 0, maxHScrollPosition:int = -1,
+					   minVScrollPosition:int = 0, maxVScrollPosition:int = -1):void
+	{
+		if (getStyle("interactionMode") == InteractionMode.TOUCH)
+		{
+			this.textSelectionAutoScrollEnabled = enable;
+			this.minTextSelectionHScrollPos = minHScrollPosition;
+			this.maxTextSelectionHScrollPos = maxHScrollPosition;
+			this.minTextSelectionVScrollPos = minVScrollPosition;
+			this.maxTextSelectionVScrollPos = maxVScrollPosition;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function setUpTextSelectionAutoScroll():void
+	{
+		if (!textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer = new Timer(1000 / TEXT_SELECTION_AUTO_SCROLL_FPS);
+			textSelectionAutoScrollTimer.addEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+
+			textSelectionAutoScrollTimer.start();
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	mx_internal function stopTextSelectionAutoScroll():void
+	{
+		if (textSelectionAutoScrollTimer)
+		{
+			textSelectionAutoScrollTimer.stop();
+			textSelectionAutoScrollTimer.removeEventListener(TimerEvent.TIMER,
+				textSelectionAutoScrollTimerHandler);
+			textSelectionAutoScrollTimer = null;
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	private function textSelectionAutoScrollTimerHandler(event:TimerEvent):void
+	{
+		const SLOW_SCROLL_THRESHOLD:int = 12;		// Distance from edge to trigger a slow scroll
+		const SLOW_SCROLL_SPEED:int = 20;			// Pixels per timer callback to scroll
+		const FAST_SCROLL_THRESHOLD:int = 3;		// Distance from edge to trigger a fast scroll
+		const FAST_SCROLL_DELTA:int = 30; 			// Added to SLOW_SCROLL_SPEED to determine fast speed
+
+		var newVSP:Number = viewport.verticalScrollPosition;
+		var newHSP:Number = viewport.horizontalScrollPosition;
+
+		if (canScrollHorizontally)
+		{
+			if (mouseX > width - SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP += SLOW_SCROLL_SPEED;
+
+				if (mouseX > width - FAST_SCROLL_THRESHOLD)
+					newHSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionHScrollPos != -1 && newHSP > maxTextSelectionHScrollPos)
+					newHSP = maxTextSelectionHScrollPos;
+			}
+
+			if (mouseX < SLOW_SCROLL_THRESHOLD)
+			{
+				newHSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseX < FAST_SCROLL_THRESHOLD)
+					newHSP -= FAST_SCROLL_DELTA;
+
+				if (newHSP < minTextSelectionHScrollPos)
+					newHSP = minTextSelectionHScrollPos;
+    		}
+		}
+
+		if (canScrollVertically)
+		{
+			if (mouseY > height - SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP += SLOW_SCROLL_SPEED;
+
+				if (mouseY > height - FAST_SCROLL_THRESHOLD)
+					newVSP += FAST_SCROLL_DELTA;
+
+				if (maxTextSelectionVScrollPos != -1 && newVSP > maxTextSelectionVScrollPos)
+					newVSP = maxTextSelectionVScrollPos;
+			}
+
+			if (mouseY < SLOW_SCROLL_THRESHOLD)
+			{
+				newVSP -= SLOW_SCROLL_SPEED;
+
+				if (mouseY < FAST_SCROLL_THRESHOLD)
+					newVSP -= FAST_SCROLL_DELTA;
+
+				if (newVSP < minTextSelectionVScrollPos)
+					newVSP = minTextSelectionVScrollPos;
+			}
+		}
+
+		if (newHSP != viewport.horizontalScrollPosition)
+			viewport.horizontalScrollPosition = newHSP;
+		if (newVSP != viewport.verticalScrollPosition)
+			viewport.verticalScrollPosition = newVSP;
+	}

     //--------------------------------------------------------------------------
     //


Transferred from the Adobe Open Source Subversion Repository

Revision: 8483
Author:   smgilson@adobe.com
Date:     2009-07-09T17:52:48.367800Z

Log Message:
-----------
Second checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/EaseInOutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Fade.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.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/effects/easing/Power.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/ShaderFilter.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/effects/CallAction.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/effects/AnimateColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale.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/primitives/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Rotate.as</path>
<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/effects/Resize.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Sine.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Move.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/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform.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/filters/ConvolutionFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/easing/Linear.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Keyframe.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/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/RemoveAction.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@1284644 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/filters/BevelFilter.as
+++ frameworks/projects/spark/src/spark/filters/BevelFilter.as
@@ -48,7 +48,7 @@
  *  attributes of its superclass and adds the following tag attributes:

  *
  *

- *  <BevelFilter
+ *  <s:BevelFilter
  *    Properties
  *    angle="45"
  *    distance="4"


Now additional loading for chapter-scope resources is worked

--- krew-framework/krewfw/core_internal/KrewResourceManager.as
+++ krew-framework/krewfw/core_internal/KrewResourceManager.as
@@ -98,14 +98,12 @@
                                              fileNameList:Array, onLoadProgress:Function,
                                              onLoadComplete:Function):void
         {
-            if (_chapterResources[chapter]) {
-                krew.fwlog("[Error] [KRM] Chapter-scope resources are already exists.");
-                krew.fwlog('   - class: ' + getQualifiedClassName(chapter));
-            }
-
-            var resource:KrewResource = new KrewResource("Chapter");
-            _chapterResources[chapter] = resource;
-            ++_numActiveChapter;
+            var resource:KrewResource = _chapterResources[chapter];
+            if (!resource) {
+                resource = new KrewResource("Chapter");
+                _chapterResources[chapter] = resource;
+                ++_numActiveChapter;
+            }

             var suitablePathList:Array = _mapToSuitablePath(fileNameList);
             resource.loadResources(suitablePathList, onLoadProgress, onLoadComplete);


Formatting

Formatting

--- src/flash/net.easyxdm.flash/Main.as
+++ src/flash/net.easyxdm.flash/Main.as
@@ -76,7 +76,7 @@
 				log("sending to " + sendingChannelName + ", length is " + message.length);

 				var origin = _root.proto + "//" + _root.domain;
-				var fragments = [], fragment,length = message.length, pos = 0 ;
+				var fragments = [], fragment, length = message.length, pos = 0;
 				while (pos <= length) {
 					fragment = message.substr(pos, maxMessageLength);;
 					pos += maxMessageLength;


Transferred from the Adobe Open Source Subversion Repository

Revision: 21947
Author:   ksimm@adobe.com
Date:     2011-08-12T01:28:00.148877Z

Log Message:
-----------
Refactor findLongestDateItem and findLongestYaerItem functions.

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as
+++ frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as
@@ -198,5 +198,23 @@

         return -1;
     }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.5.2
+     */
+    override public function toArray():Array
+    {
+        var result:Array = [];
+        var numItems:int = length;
+
+        for (var i:int = 0; i < numItems; i++)
+            result.push(getItemAt(i));
+
+        return result;
+    }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 22172
Author:   jszeto@adobe.com
Date:     2011-08-23T23:58:28.507994Z

Log Message:
-----------
SpinnerList Bug Fixes (fontColor / disabled items)

DateSpinner now supports fontSize. SpinnerList and DateSpinner now use the global fontSize instead of specify a larger default size.

SDK-31014 - Inconsistent behavior when all items in a SpinnerList are disabled

When useVirtualLayout is true, the element might not exist. We check the data directly instead asking the element if it is enabled.

SDK-30990 - SpinnerList does not respect text color

Both DateSpinner and SpinnerList should now support the color style. Changed the accentColor and disabled logic for setting the color. Now we set the colorName property so StyleableTextField knows which style to use. Disabled items are set to an alpha of .5.

QE notes: baselines will need updating
Doc notes: none
Bugs: SDK-30990, SDK-31014
Reviewer: Tom K
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/layouts/VerticalSpinnerLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/YearProvider.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as
+++ frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateAndTimeProvider.as
@@ -54,7 +54,7 @@
      *  @productversion Flex 4.5.2
      */
     public function DateAndTimeProvider(locale:String, start:Date, end:Date,
-                                        today:Date = null, todayAccentColor:uint = 0)
+                                        today:Date = null)
     {
         if (start == null)
             start = MIN_DATE_DEFAULT;
@@ -89,7 +89,6 @@
         formatter.dateTimeSkeletonPattern = DateTimeFormatterEx.DATESTYLE_MMMEEEd;

         todayDate = today;
-        accentColor = todayAccentColor;
     }

     //----------------------------------------------------------------------------------------------
@@ -107,10 +106,7 @@
     private var endDate:Date;

     private var todayDate:Date;
-
-    // color to apply as accent color for dates that match today's date
-    private var accentColor:uint;
-
+
     // formatter to use in localizing the date labels
     private var formatter:DateTimeFormatterEx;

@@ -165,7 +161,7 @@
                 d.getMonth() == todayDate.getMonth() &&
                 d.getDate() == todayDate.getDate())
             {
-                item["accentColor"] = accentColor;
+                item["_emphasized_"] = true;
             }
         }


Do not initialize the quick menu twice.

Do not initialize the quick menu twice.

--- Bin/Data/Scripts/Editor/EditorUI.as
+++ Bin/Data/Scripts/Editor/EditorUI.as
@@ -64,8 +64,6 @@
     SubscribeToEvent("KeyDown", "HandleKeyDown");
     SubscribeToEvent("KeyUp", "UnfadeUI");
     SubscribeToEvent("MouseButtonUp", "UnfadeUI");
-
-    CreateQuickMenu();
 }

 void ResizeUI()


Changed behavior of file param so it won't affect base url used in URLRequestUtils unless Capabilities.playerType is "Desktop".

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -268,7 +268,7 @@
 			}
 			else
 			{
-				if (Capabilities.localFileReadDisable == false)
+				if (Capabilities.playerType == "Desktop")
 					WeaveAPI.URLRequestUtils.setBaseURL(fileName);
 				loadSessionState(event.result, fileName);
 			}


moved lang() call

moved lang() call

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -452,7 +452,7 @@
 		private static const CONFIG_FILE_FLASH_VAR_NAME:String = 'file';
 		private static const DEFAULT_CONFIG_FILE_NAME:String = 'defaults.xml';
 		private var _usingDeprecatedFlashVar:Boolean = false;
-		private const DEPRECATED_FLASH_VAR_MESSAGE:String = lang("The 'defaults=' URL parameter is deprecated.  Use 'file=' instead.");
+		private const DEPRECATED_FLASH_VAR_MESSAGE:String = "The 'defaults=' URL parameter is deprecated.  Use 'file=' instead.";

 		private var _selectionIndicatorText:Text = new Text();
 		private var selectionKeySet:KeySet = Weave.defaultSelectionKeySet;
@@ -790,7 +790,7 @@
 				{
 					Weave.loadWeaveFileContent(ByteArray(fileContent));
 					if (_usingDeprecatedFlashVar)
-						reportError(DEPRECATED_FLASH_VAR_MESSAGE);
+						reportError(lang(DEPRECATED_FLASH_VAR_MESSAGE));
 				}
 			}
 			catch (error:Error)


[SequenceAssembler] implemented paste from excel

git-svn-id: adbdea8fc1759bd16b0eaf24a244a7e5f870a654@195 fe3f0490-d73e-11de-a956-c71e7d3a9d2f

--- SequenceAssemblerStandalone/src/org/jbei/registry/components/assemblyTableClasses/ContentHolder.as
+++ SequenceAssemblerStandalone/src/org/jbei/registry/components/assemblyTableClasses/ContentHolder.as
@@ -10,6 +10,7 @@
     import flash.events.KeyboardEvent;
     import flash.events.MouseEvent;
     import flash.geom.Point;
+    import flash.text.TextField;
     import flash.ui.ContextMenu;
     import flash.ui.Keyboard;

@@ -17,6 +18,7 @@
     import mx.core.UIComponent;
     import mx.events.CloseEvent;
     import mx.events.ScrollEvent;
+    import mx.utils.StringUtil;

     import org.jbei.registry.components.AssemblyTable;
     import org.jbei.registry.models.AssemblyItem;
@@ -430,8 +432,51 @@

                 pasteFromClipboard();
             } else if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)) {
-                trace("paste as text!");
-            }
+                var pasteText:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;
+
+                if(pasteText && pasteText != "") {
+                    pasteAssemblyItems = assemblyItemsFromText(pasteText);
+
+                    pasteFromClipboard();
+                }
+            }
+        }
+
+        private function assemblyItemsFromText(text:String):Vector.<Vector.<AssemblyItem>>
+        {
+            var resultItems:Vector.<Vector.<AssemblyItem>> = new Vector.<Vector.<AssemblyItem>>();
+
+            var lines:Array = text.split("\n");
+
+            if(!lines || lines.length == 0) {
+                return null;
+            }
+
+            for(var i:int = 0; i < lines.length; i++) {
+                var line:String = StringUtil.trim(lines[i]);
+
+                if(!line || line == "") {
+                    continue;
+                }
+
+                var fields:Array = line.split("\t");
+
+                if(!fields || fields.length == 0) {
+                    continue;
+                }
+
+                for(var j:int = 0; j < fields.length; j++) {
+                    var newAssemblyItem:AssemblyItem = new AssemblyItem(fields[j]);
+
+                    if(resultItems.length == j) {
+                        resultItems.push(new Vector.<AssemblyItem>());
+                    }
+
+                    resultItems[j].push(newAssemblyItem);
+                }
+            }
+
+            return resultItems;
         }

         private function onSelectAll(event:Event):void


Ispravljen bug.

Ispravljen bug.

--- src/Modi/ManagedArray.as
+++ src/Modi/ManagedArray.as
@@ -50,11 +50,11 @@
 				return;
 			}

-			willRemove(object, index);
+			willAdd(object, index);

 			_data.push(object);

-			wasRemoved(object, index);
+			wasAdded(object, index);
 		}

 		public function pushMultiple(array:Array):void
@@ -204,7 +204,7 @@
 		{
 			if (_observers[event] == undefined)
 			{
-				throw new Error("Event " + event + " does not exists nor can it be tracked!");
+				throw new Error("Event " + event + " does not exist nor can it be tracked!");
 			}

 			_observers[event].push(new IObserver(event, callback));
@@ -214,7 +214,7 @@
 		{
 			if (_observers[event] == undefined)
 			{
-				throw new Error("Event " + event + " does not exists nor can it be tracked!");
+				throw new Error("Event " + event + " does not exist nor can it be tracked!");
 			}

 			var length:int = _observers[event].length;


- bugfix: changed the LINK_CLICK event dispatched by the Anchor element to bubble just as the one dispatched from Label does

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

--- src/reprise/controls/html/Anchor.as
+++ src/reprise/controls/html/Anchor.as
@@ -52,7 +52,7 @@
 		***************************************************************************/
 		protected override function buttonDisplay_click(event : MouseEvent) : void
 		{
-			var htmlEvent : LabelEvent = new LabelEvent(LabelEvent.LINK_CLICK);
+			var htmlEvent : LabelEvent = new LabelEvent(LabelEvent.LINK_CLICK, true);
 			htmlEvent.href = m_href;
 			htmlEvent.linkTarget = m_target;
 			dispatchEvent(htmlEvent);


Added Integer.compare(). I wish Java had such a method (that worked on int
values rather than Integer values).

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

--- src/as/com/threerings/util/Integer.as
+++ src/as/com/threerings/util/Integer.as
@@ -34,5 +34,13 @@
     {
         return value;
     }
+
+    /**
+     * Compares to int values in an overflow safe manner.
+     */
+    public static function compare (val1 :int, val2 :int) :int
+    {
+        return (val1 > val2) ? 1 : (val1 == val2 ? 0 : -1);
+    }
 }
 }


fixed iso matrix orientation for XY plane

--- src/as3isolib/utils/IsoDrawingUtil.as
+++ src/as3isolib/utils/IsoDrawingUtil.as
@@ -239,6 +239,7 @@
 					m2.scale(1, 0.5);

 					m.rotate(Math.PI / 4);
+					m.scale(Math.SQRT2, Math.SQRT2);
 					m.concat(m2);

 					break;


added a comment

added a comment

--- src/com/nodename/Delaunay/Halfedge.as
+++ src/com/nodename/Delaunay/Halfedge.as
@@ -28,6 +28,8 @@
 		public var edge:Edge;
 		public var leftRight:LR;
 		public var vertex:Vertex;
+
+		// the vertex's y-coordinate in the transformed Voronoi space V*
 		public var ystar:Number;

 		public function Halfedge(lock:Class, edge:Edge = null, lr:LR = null)


update

update

fix the Bug when receive PUBLISH message with Qos is 0

--- MQTTClient_AS3/src/com/godpaper/mqtt/as3/impl/MQTTSocket.as
+++ MQTTClient_AS3/src/com/godpaper/mqtt/as3/impl/MQTTSocket.as
@@ -453,6 +453,7 @@
 		//
 		protected function onClose(event:Event):void
 		{
+			LOG.error("MQTT IO Error: {0}", event);
 			// Security error is thrown if this line is excluded
 			//dispatch event
 			this.dispatchEvent(new MQTTEvent(MQTTEvent.CLOSE, false, false));
@@ -631,12 +632,29 @@
 			var topicName:String = varHead.readMultiByte(length, "utf8");
 			var messageId:uint = (varHead.readUnsignedByte() << 8) + varHead.readUnsignedByte();
 			var payLoad:ByteArray = packet.readPayLoad();
-			length = (payLoad.readUnsignedByte() << 8) + payLoad.readUnsignedByte();
+			if( packet.readQoS() )
+				length = (payLoad.readUnsignedByte() << 8) + payLoad.readUnsignedByte();
+			else
+				length = packet.readPayLoad().length;
 			var topicContent:String = payLoad.readMultiByte(length, "utf8");

 			LOG.info("Publish Message ID {0}", messageId);
 			LOG.info("Publish TopicName {0}", topicName);
 			LOG.info("Publish TopicContent {0}", topicContent);
+
+			var bytes:ByteArray=new ByteArray();
+			msgid++;
+			bytes.writeByte(messageId >> 8);
+			bytes.writeByte(messageId % 256);
+			var type:int=MQTT_Protocol.PUBACK;
+			type += (packet.readQoS() << 1);
+			this.pubackMessage=new MQTT_Protocol();
+			this.pubackMessage.writeMessageType(type);
+			this.pubackMessage.writeMessageValue(bytes);
+			//
+			LOG.info("MQTT pubackMessage.length:{0}", this.pubackMessage.length);
+			this.socket.writeBytes(this.pubackMessage, 0, this.pubackMessage.length);
+			this.socket.flush();
 		}

 		//A PUBACK message is the response to a PUBLISH message with QoS level 1. A PUBACK
@@ -677,7 +695,7 @@
 					bytes.writeByte(messageId >> 8);
 					bytes.writeByte(messageId % 256);
 					var type:int=MQTT_Protocol.PUBREL;
-					type += (2 << 1);
+					type += (1 << 1);
 					this.pubrelMessage=new MQTT_Protocol();
 					this.pubrelMessage.writeMessageType(type);
 					this.pubrelMessage.writeMessageValue(bytes);


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

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

 package mx.controls.advancedDataGridClasses
 {