Transferred from the Adobe Open Source Subversion Repository

Revision: 13756
Author:   hmuller@adobe.com
Date:     2010-01-25T19:42:14.082913Z

Log Message:
-----------
Mirroring changes, fixes.

- Removed ILayout interface, added mirroring API to IVisualElement.
- Moved layoutDirection="ltr" initialization from TextBase to defaults.css.   Removed similar initialization from DefaultItemRenderer (it wasn't needed).
- The 'get layoutDirection()' method for UIMovieClip, GraphicElement, and SpriteVisualElement now queries the parent if the local value is "inherit".
- Use @inheritDoc instead of explicitly @copying interface methods' ASDoc.   Don't call invalidateLayoutDirection() if FlexVersion.compatibilityVersion is < 4.0.
- Don't call invalidateLayout() for a child unless either its layoutDirection has changed, or its parent's layoutDirection has changed.

QE notes: These changes were cycloned.
Doc notes:
Bugs: sdk-25204, sdk-25209
Reviewer: Evtim
Tests run:
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutDirection.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
+++ frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
@@ -32,7 +32,6 @@
 import mx.core.IFlexModule;
 import mx.core.IFlexModuleFactory;
 import mx.core.IInvalidating;
-import mx.core.ILayoutDirection;
 import mx.core.IMXMLObject;
 import mx.core.IUIComponent;
 import mx.core.IVisualElement;
@@ -1954,13 +1953,20 @@

 	private var _layoutDirection:String = "inherit";

+    /**
+     *  @inheritDoc
+     */
 	public function get layoutDirection():String
 	{
-		return _layoutDirection;
+        if (_layoutDirection != "inherit")
+            return _layoutDirection;
+
+        const parentElt:IVisualElement = parent as IVisualElement;
+        return (parentElt) ? parentElt.layoutDirection : "ltr";
 	}

 	/**
-	 *  @copy mx.core.IVisualElement#layoutDirection
+	 *  @private
 	 */
 	public function set layoutDirection(value:String):void
 	{
@@ -1972,11 +1978,11 @@
 	}

     /**
-     * @copy mx.core.ILayoutDirection#invalidateLayoutDirection()
+     * @inheritDoc
      */
     public function invalidateLayoutDirection():void
     {
-        const parentElt:ILayoutDirection = parent as ILayoutDirection;
+        const parentElt:IVisualElement = parent as IVisualElement;
         if (!parentElt)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 7862
Author:   jszeto@adobe.com
Date:     2009-06-15T22:06:23.250745Z

Log Message:
-----------
GraphicElement PARB Changes

mx.core.AdvancedLayoutFeatures
•	Rename layer -> depth
•	Rename offsets -> postLayoutTransformOffsets

mx.core.IVisualElement
•	Rename layer -> depth

mx.core.UIComponent
•	Rename offsets -> postLayoutTransformOffsets
•	Rename layer -> depth

mx.graphics.GradientBase
•	Remove scaleX

mx.graphics.GradientStroke
•	Add apply(g:Graphics, bounds:Rectangle)

mx.graphics.IStroke
•	Remove draw
•	Change apply(g:Graphics) -> apply(g:Graphics, bounds:Rectangle)

mx.graphics.LinearGradient
•	Add scaleX

mx.graphics.LinearGradientStroke
•	Add scaleX
•	Remove draw
•	Change apply(g:Graphics) -> apply(g:Graphics, bounds:Rectangle)

mx.graphics.RadialGradient
•	Add scaleX

mx.graphics.RadialGradientStroke
•	Add scaleX
•	Remove draw
•	Change apply(g:Graphics) -> apply(g:Graphics, bounds:Rectangle)

mx.graphics.SolidColorStroke
•	Remove draw
•	Change apply(g:Graphics) -> apply(g:Graphics, bounds:Rectangle)

mx.flash.UIMovieClip
•	Rename offsets -> postLayoutTransformOffsets
•	Rename layer -> depth

spark.components.PopUpAnchor
•	Change popUp type from UIComponent -> IFlexDisplayObject
•	Rename positionPopUp -> calculatePopUpPosition
•	Rename autoSizePopUpWidth -> popUpWidthMatchesAnchorWidth
•	Rename autoSizePopUpHeight -> popUpHeightMatchesAnchorHeight

spark.core.RelativePosition
•	Rename and move spark.core.RelativePosition -> spark.components.PopUpPosition
•	Rename EXACT -> TOP_LEFT (topLeft)

spark.core.SpriteVisualElement
•	Rename layer -> depth
•	Remove computeMatrix

spark.primitives.BitmapImage
•	Change _NORMAL_UINT from protected -> private
•	Change _REPEAT_UINT from protected -> private
•	Change _SCALE_UINT from protected -> private
•	Change resizeModeToUINT from protected -> private
•	Rename drawElement -> draw

spark.primitives.Line
•	Rename skipMeasure -> canSkipMeasurement
•	Rename drawElement -> draw

spark.primitives.Path
•	Change graphicsPath fro protected -> mx_internal
•	Rename skipMeasure -> canSkipMeasurement
•	Rename drawElement -> draw
•	Rename renderGraphicsAtScale -> generateGraphicsPath
•	Change generateGraphicsPath from protected -> mx_internal
•	Rename notifyElementLayerChanged -> invalidateDisplayObjectSharing

spark.primitives.Rect
•	Rename drawElement -> draw

spark.primitives.supportClasses.GraphicElement
•	Rename layer -> depth
•	Rename offsets -> postLayoutTransformOffsets
•	Rename getBitmapData -> captureBitmapData
•	Rename notifyElementLayerChanged -> invalidateDisplayObjectSharing
•	Rename skipMeasure -> canSkipMeasurement
•	Add protected hasComplexLayoutMatrix:Boolean getter
•	Remove target
•	Remove computeMatrix
•	Change DEFAULT_MAX_WIDTH from public -> private
•	Change DEFAULT_MAX_HEIGHT from public -> private
•	Change DEFAULT_MIN_WIDTH from public -> private
•	Change DEFAULT_MIN_HEIGHT from public -> private
•	Change allocateLayoutFeatures from protected -> mx_internal
•	Change invalidateTransform from protected -> private
•	Change captureBitmapData from public -> mx_internal
•	Change applyMaskType from protected -> mx_internal
•	Change dispatchPropertyChangeEvent from protected -> private
•	Change applyComputedTransform from protected -> mx_internal
•	Change filterChangedHandler from protected -> private

spark.supportClasses.StrokedElement
•	Rename drawElement -> draw
•	Remove getStroke()
•	Add getStrokeExtents() override

QE Notes: None
Doc Notes: None
Bugs: N/A
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Ellipse.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/FilledElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/BitmapFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/GradientBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransitionShaderInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IFill.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColorStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/SolidColor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/RadialGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/IStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradientStroke.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/LinearGradient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
+++ frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
@@ -211,32 +211,32 @@
     }

     //----------------------------------
-    //  layer
+    //  depth
     //----------------------------------

     /**
      *  @private
-     *  Storage for the layer property.
-     */
-    private var _layer:Number = 0;
+     *  Storage for the depth property.
+     */
+    private var _depth:Number = 0;

     /**
      * @inheritDoc
      */
-    public function get layer():Number
-    {
-        return _layer;
-    }
-
-    /**
-     *  @private
-     */
-    public function set layer(value:Number):void
-    {
-        if(value == _layer)
-            return;
-
-        _layer = value;
+    public function get depth():Number
+    {
+        return _depth;
+    }
+
+    /**
+     *  @private
+     */
+    public function set depth(value:Number):void
+    {
+        if(value == _depth)
+            return;
+
+        _depth = value;
         if(parent != null && "invalidateLayering" in parent && parent["invalidateLayering"] is Function)
             parent["invalidateLayering"]();
     }
@@ -519,22 +519,11 @@
     //--------------------------------------------------------------------------

     /**
-     *  Gets the transformation matrix.
-     *
-     *  @return Returns the transformation matrix for this element, or null
-     *  if it is delta identity.
-     */
-    protected function computeMatrix():Matrix
-    {
-        return transform.matrix;
-    }
-
-    /**
      *  @inheritDoc
      */
     public function getLayoutBoundsX(postLayoutTransform:Boolean = true):Number
     {
-        var m:Matrix = postLayoutTransform ? computeMatrix() : null;
+        var m:Matrix = postLayoutTransform ? transform.matrix : null;
         if (!m)
             return x;

@@ -548,7 +537,7 @@
      */
     public function getLayoutBoundsY(postLayoutTransform:Boolean = true):Number
     {
-        var m:Matrix = postLayoutTransform ? computeMatrix() : null;
+        var m:Matrix = postLayoutTransform ? transform.matrix : null;
         if (!m)
             return y;

@@ -633,7 +622,7 @@
     {
         var m:Matrix;
         if (!postLayoutTransform)
-            m = computeMatrix();
+            m = transform.matrix;
         if (!m)
             return x;

@@ -662,7 +651,7 @@
     {
         var m:Matrix;
         if (!postLayoutTransform)
-            m = computeMatrix();
+            m = transform.matrix;
         if (!m)
             return y;

@@ -724,7 +713,7 @@
         // Calculate the width and height pre-transform:
         var m:Matrix;
         if (postLayoutTransform)
-            m = computeMatrix();
+            m = transform.matrix;
         if (!m)
         {
             if (isNaN(width))
@@ -817,7 +806,7 @@
     {
         if (postLayoutTransform)
         {
-            var m:Matrix = computeMatrix();
+            var m:Matrix = transform.matrix;
             if (m)
             {
                 var size:Point = new Point(width, height);
@@ -844,7 +833,7 @@
     {
         if (postLayoutTransform)
         {
-            var m:Matrix = computeMatrix();
+            var m:Matrix = transform.matrix;
             if (m)
             {
                 var size:Point = new Point(width, height);


Order vairable added todecide order of association

SVN-Revision: 9306

--- flexclient/dag/Components/Association.as
+++ flexclient/dag/Components/Association.as
@@ -6,12 +6,14 @@
 		public var associatedNode:String;
 		public var associatedLink:String;
 		public var operatorIndex:int;
+		public var order:int=0;

-		public function Association(associatedNode:String,associatedLink:String,operatorIndex:int)
+		public function Association(associatedNode:String,associatedLink:String,operatorIndex:int,order:int)
 		{
 			this.associatedLink = associatedLink;
 			this.associatedNode = associatedNode;
 			this.operatorIndex  = operatorIndex;
+			this.order=order;
 		}

 	}


variable name changes

variable name changes

--- WeaveUISpark/src/weave/utils/VisToolGroup.as
+++ WeaveUISpark/src/weave/utils/VisToolGroup.as
@@ -36,16 +36,16 @@
 	 */
 	public class VisToolGroup implements ILinkableObject
 	{
-		public const globalColorColumn:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(ColorColumn));
-		public const globalProbeKeySet:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeySet));
-		public const globalSelectionKeySet:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeySet));
-		public const globalSubsetKeyFilter:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeyFilter));
+		public const colorColumn:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(ColorColumn));
+		public const probeKeySet:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeySet));
+		public const selectionKeySet:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeySet));
+		public const subsetKeyFilter:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IKeyFilter));

-		public function getColorColumn():ColorColumn { return globalColorColumn.internalObject as ColorColumn; }
+		public function getColorColumn():ColorColumn { return colorColumn.internalObject as ColorColumn; }
 		public function getColorBinColumn():BinnedColumn { return getColorColumn().getInternalColumn() as BinnedColumn; }
 		public function getColorDataColumn():FilteredColumn { return getColorBinColumn().getInternalColumn() as FilteredColumn; }
-		public function getProbe():IKeySet { return globalProbeKeySet.internalObject as IKeySet; }
-		public function getSelection():IKeySet { return globalSelectionKeySet.internalObject as IKeySet; }
-		public function getSubset():IKeyFilter { return globalSubsetKeyFilter.internalObject as IKeyFilter; }
+		public function getProbe():IKeySet { return probeKeySet.internalObject as IKeySet; }
+		public function getSelection():IKeySet { return selectionKeySet.internalObject as IKeySet; }
+		public function getSubset():IKeyFilter { return subsetKeyFilter.internalObject as IKeyFilter; }
 	}
 }


Add some more sprite features and some slow down

--- index.as
+++ index.as
@@ -20,6 +20,7 @@
 extern def fflush(stream: *FILE);
 extern def strncpy(dst: str, src: str, count: size_t): str;
 extern def clock(): uint64;
+extern def rand(): c_int;
 extern def sleep(seconds: uint32);

 let CLOCKS_PER_SEC: uint64 = 1000000;
@@ -4623,6 +4624,7 @@
     //    Bit2-0 Palette number  **CGB Mode Only**     (OBP0-7)

     let i = 0;
+    let total = 0;
     while i < 40 {
       let offset = (i * 4);

@@ -4636,6 +4638,12 @@

       if sprite_y <= int16(gpu_line) and (sprite_y + 8) > int16(gpu_line) {

+        total += 1;
+        if total > 10 {
+          // No more sprites
+          break;
+        }
+
         let tile_y: int16 = int16(gpu_line) - sprite_y;
         let td_address: int16 = sprite_tile * 16 + int16(tile_y) * 2;

@@ -4646,7 +4654,7 @@
         while x < 8 {
           if (sprite_x + x >= 0) and (sprite_x + x < 160) {
             // Make a bitmask for the pixel being rendered
-            let pixel_mask = 0x80 >> ((sprite_x + x) % 8);
+            let pixel_mask = 0x80 >> (if testb(sprite_flags, 5) { 7 - x; } else { x; });

             // Check the color bits for that pixel
             let palette_lo = if *(vram + td_address) & pixel_mask != 0 { 1; } else { 0; };
@@ -4654,16 +4662,26 @@

             // Combine them into a single index from 0 to 3
             let palette_index = uint8((palette_hi << 1) | palette_lo);
-
-            // Palette
-            let color = if testb(sprite_flags, 4) {
-              (gpu_obj0_palette >> (palette_index * 2)) & 0x3;
-            } else {
-              (gpu_obj1_palette >> (palette_index * 2)) & 0x3;
-            };
-
-            // Push pixel to framebuffer
-            *(gpu_framebuffer + (int64(gpu_line) * 160) + (sprite_x + x)) = color;
+            // NOTE: 0 is transparent for sprites
+            if palette_index != 0 {
+              // Palette
+              let color = if testb(sprite_flags, 4) {
+                (gpu_obj1_palette >> (palette_index * 2)) & 0x3;
+              } else {
+                (gpu_obj0_palette >> (palette_index * 2)) & 0x3;
+              };
+
+              // Push pixel to framebuffer
+              let fbo: int64 = (int64(gpu_line) * 160) + int64(sprite_x + x);
+              if testb(sprite_flags, 7) {
+                let bgcolor = *(gpu_framebuffer + fbo);
+                if bgcolor == 0 {
+                  *(gpu_framebuffer + fbo) = color;
+                }
+              } else {
+                *(gpu_framebuffer + fbo) = color;
+              }
+            }
           }

           x += 1;
@@ -4957,7 +4975,6 @@
 // [CX] Core
 // =============================================================================
 def execute() {
-  // TODO: Method to stop/pause/etc.
   while is_running {
     // STEP -> CPU
     let cycles = cpu_step();
@@ -5041,7 +5058,7 @@

   // Create renderer
   _renderer = SDL_CreateRenderer(_window, -1,
-    SDL_RENDERER_ACCELERATED);
+    SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);

   // White initial screen
   SDL_SetRenderDrawColor(_renderer, 155, 188, 15, 255);


Added popLeftwards. Only really useful for menus without submenus.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@198 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flex/CommandMenu.as
+++ src/as/com/threerings/flex/CommandMenu.as
@@ -93,8 +93,8 @@
     /**
      * Actually pop up the menu. This can be used instead of show().
      */
-    public function popUp (
-        trigger :DisplayObject, popUpwards :Boolean = false) :void
+    public function popUp (trigger :DisplayObject, popUpwards :Boolean = false,
+                           popLeftwards :Boolean = false) :void
     {
         var r :Rectangle = trigger.getBounds(trigger.stage);

@@ -106,6 +106,11 @@
         } else {
             // position it below the trigger
             show(r.x, r.y + r.height);
+        }
+
+        if (popLeftwards) {
+            // reposition the x now that we know our size
+            x = r.x + r.width - getExplicitOrMeasuredWidth();
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 9270
Author:   clucier@adobe.com
Date:     2009-08-13T15:27:57.150840Z

Log Message:
-----------
Preliminary checkin of the 4+ runtime design layer feature.  Note that this is being committed primarily so that the tooling folks can start playing.  We've yet to integrate spec or PARB feedback
as such QE does not yet need to test.

QE notes: No need to test just yet.
Doc notes: Ditto
Bugs: N/A
Reviewer: Glenn / Paul
Tests run: Checkin
Is noteworthy for integration: Yes, Catalyst/FB may enable feature to begin integration if so desired.  Enable with compiler flag "-enable-runtime-design-layers".

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.java</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/DesignLayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/ValueNodeHandler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/Analyzer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/AnalyzerAdapter.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/MxmlScanner.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/frameworkSwcExceptionsList.txt</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java</path>
<path kind="file" action="A">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/LayeredNode.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/DocumentBuilder.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/SyntaxAnalyzer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Model.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/NodeTypeResolver.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DesignLayerNode.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/SyntaxTreeBuilder.java</path>
<path kind="file" action="A">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/DesignLayer.java</path>

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

--- frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
+++ frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
@@ -32,6 +32,7 @@

 import mx.automation.IAutomationObject;
 import mx.core.AdvancedLayoutFeatures;
+import mx.core.DesignLayer;
 import mx.core.IConstraintClient;
 import mx.core.IDeferredInstantiationUIComponent;
 import mx.core.IFlexDisplayObject;
@@ -45,6 +46,7 @@
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
 import mx.events.MoveEvent;
+import mx.events.PropertyChangeEvent;
 import mx.events.ResizeEvent;
 import mx.events.StateChangeEvent;
 import mx.geom.TransformOffsets;
@@ -680,7 +682,43 @@
     //  Public variables
     //
     //--------------------------------------------------------------------------
-
+
+    //----------------------------------
+    //  alpha
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the alpha property.
+     */
+    private var _alpha:Number = 1.0;
+
+    /**
+     *  @private
+     */
+    override public function get alpha():Number
+    {
+        // Here we roundtrip alpha in the same manner as the
+        // player (purposely introducing a rounding error).
+        return int(_alpha * 256.0) / 256.0;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set alpha(value:Number):void
+    {
+        if (_alpha != value)
+        {
+            _alpha = value;
+
+            if (layer)
+                value = value * layer.computedAlpha;
+
+            super.alpha = value;
+        }
+    }
+
     //----------------------------------
     //  autoUpdateMeasuredSize
     //----------------------------------
@@ -1769,6 +1807,45 @@
     public function set isPopUp(value:Boolean):void
     {
         _isPopUp = value;
+    }
+
+    //----------------------------------
+    //  layer
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the layer property.
+     */
+    private var _layer:DesignLayer;
+
+    [Inspectable (environment='none')]
+
+    /**
+     *  @copy mx.core.IVisualElement#layer
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get layer():DesignLayer
+    {
+        return _layer;
+    }
+
+    /**
+     *  @private
+     */
+    public function set layer(value:DesignLayer):void
+    {
+        if (_layer)
+            _layer.removeEventListener("layerPropertyChange", layer_PropertyChange, false);
+
+        _layer = value;
+
+        if (_layer)
+            _layer.addEventListener("layerPropertyChange", layer_PropertyChange, false, 0, true);
     }

     //----------------------------------
@@ -2119,6 +2196,20 @@
     //  visible
     //----------------------------------

+    /**
+     *  @private
+     *  Storage for the visible property.
+     */
+    private var _visible:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     */
+    override public function get visible():Boolean
+    {
+        return _visible;
+    }
+
     /**
      *  @private
      */
@@ -4043,6 +4134,14 @@
      */
     public function setVisible(value:Boolean, noEvent:Boolean = false):void
     {
+        _visible = value;
+
+        if (layer && !layer.computedVisibility)
+            value = false;
+
+        if (super.visible == value)
+            return;
+
         super.visible = value;

         if (!noEvent)
@@ -4575,6 +4674,31 @@
             parentDocument.systemManager.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeCaptureHandler,
                                                  true, 0, true);
     }
+
+    /**
+     *  @private
+     */
+    protected function layer_PropertyChange(event:PropertyChangeEvent):void
+    {
+        switch (event.property)
+        {
+            case "visible":
+            {
+                var newValue:Boolean = (event.newValue && _visible);
+                if (newValue != super.visible)
+                    super.visible = newValue;
+                break;
+            }
+            case "alpha":
+            {
+                var newAlpha:Number = Number(event.newValue) * _alpha;
+                if (newAlpha != super.alpha)
+                    super.alpha = newAlpha;
+                break;
+            }
+        }
+    }
+
    // IAutomationObject Interface defenitions
    private var _automationDelegate:IAutomationObject;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

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

 		// Derivative styles.


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/mx/src/mx/skins/halo/MenuBarBackgroundSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/MenuBarBackgroundSkin.as
@@ -21,6 +21,11 @@

 /**
  *  The skin for the background of a MenuBar.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class MenuBarBackgroundSkin extends Border
 {
@@ -76,6 +81,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function MenuBarBackgroundSkin()
 	{


Transferred from the Adobe Open Source Subversion Repository

Revision: 19777
Author:   smgilson@adobe.com
Date:     2011-01-17T16:40:41.362914Z

Log Message:
-----------
ASDoc edits on validators

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationUtils.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>

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

--- frameworks/projects/spark/src/spark/validators/NumberValidator.as
+++ frameworks/projects/spark/src/spark/validators/NumberValidator.as
@@ -32,63 +32,37 @@

 /**
  *  The NumberValidator class ensures that a String represents a valid number
- *  according to the conventions of a locale.  It can validate int,
- *  uint, and Number objects.
- *
- *
It can ensure that the input falls within a given range
+ *  according to the conventions of a locale.  It can validate int,
+ *  uint, and Number objects.
+ *  This class uses the locale style for specifying the
+ *  requested locale ID.
+ *
+ *
The validator can ensure that the input falls within a given range
  *  (specified by minValue and maxValue  properties),
  *  is an integer (specified by domain  property),
  *  is non-negative (specified by allowNegative  property),
  *  has the grouping of digits correct per the locale conventions,
  *  has the correct way of specifying negative numbers,
- *  and does not exceed the specified fractionalDigits. The
- *  validator sets default property values from the operating system supplied
+ *  and does not exceed the specified fractionalDigits.
+ *  The validator sets default property values from the operating system supplied
  *  locale data but they can be customized for specific needs.

  *
- *
This class internally uses the flash.globalization.NumberFormatter
- *   to obtain locale-specific information.
- *  The NumberValidator class can be used in MXML declarations or in
- *  ActionScript code. This class uses the locale style for specifying the
- *  requested Locale ID, and has methods and properties that are bindable.
- *

- *

- *  The flash.globalization.NumberFormatter class uses the underlying
+ *
The flash.globalization.NumberFormatter class uses the underlying
  *  operating system for acquiring locale-specific data and parsing
  *  functionality. In case the operating system does not provide number
- *  formatting, this class provides fallback functionality.
- *

+ *  formatting, this class provides fallback functionality.

  *
  *  @mxml
  *
- *
The <spark:NumberValidator> tag
+ *
The <s:NumberValidator> tag
  *  inherits all of the tag attributes of its superclass,
  *  and adds the following tag attributes:

  *
  *

- *  <spark:NumberValidator
- *    allowNegative="true|false"
- *    decimalPointCountError="The decimal separator can only occur once."
- *    decimalSeparator="(locale specified string or customized by user)."
- *    domain="real|int"
- *    exceedsMaxError="The number entered is too large."
- *    integerError="The number must be an integer."
- *    invalidCharError="The input contains invalid characters."
- *    invalidFormatCharsError="One of the formatting parameters is invalid."
- *    lowerThanMinError="The amount entered is too small."
- *    maxValue="NaN"
- *    minValue="NaN"
- *    negativeError="The amount may not be negative."
- *    negativeNumberFormatError="The negative format of the input number is
- *    incorrect."
- *    negativeSymbol="(locale specified read-only string)."
- *    negativeSymbolError="The negative symbol is repeated or not in right
- *    place."
- *    parseError="The input string could not be parsed."
- *    fractionalDigits="(locale specified number or customized by user)."
- *    fractionalDigitsError="The amount entered has too many digits beyond the
- *    decimal point."
- *    groupingSeparator="(locale specified string or customized by user)."
- *    groupingSeparationError="The number digits grouping is not following the
+ *  <s:NumberValidator
+ *    Properties
+ *    negativeNumberFormat="locale specified string or customized by user."
+ *    negativeNumberFormatError="The negative format of the input number is incorrect."
  *  />
  *

  *
@@ -126,42 +100,41 @@
      *  Constructs a new NumberValidator object to validate numbers according
      *  to the conventions of a given locale.
      *

-     *  The locale for this class is supplied by the locale style.
-     *  The locale style can be set in several ways:
+     *  The locale for this class is supplied by the locale style property.
+     *  The locale style can be set in several ways:
      *

      *

-     *
         *
+     *

      *  Inheriting the style from a UIComponent by calling the UIComponent's
-     *  addStyleClient method.
+     *  addStyleClient() method.
      *

      *

      *  By using the class in an MXML declaration and inheriting the
      *  locale from the document that contains the declaration.
-     *  <listing version="3.0" >
+     *

      *  <fx:Declarations>
      *         <s:NumberValidator id="nv" />
      *  </fx:Declarations>
-     *  </listing>
+     *

      *

      *

      *  By using an MXML declaration and specifying the locale value in
      *  the list of assignments.
-     *  <listing version="3.0" >
+     *

      *  <fx:Declarations>
      *      <s:NumberValidator id="nv_French_France" locale="fr_FR" />
      *  </fx:Declarations>
-     *  </listing>
+     *

      *

      *

-     *  Calling the setStyle method, e.g.
-     *  nv.setStyle("locale", "fr-FR")
+     *  Calling the setStyle() method.
+     *  For example: nv.setStyle("locale", "fr-FR");
      *

      *

      *

-     *  If the locale style is not set by one of the above techniques,
-     *  the methods of this class that depend on the locale
-     *  will throw an error.
-     *
         *
+     *  If the locale style is not set by one of the above techniques,
+     *  the methods of this class that depend on the locale throw an error.
+     *

      *
      *  @langversion 3.0
      *  @playerversion Flash 10.1
@@ -376,6 +349,8 @@
     }

     /**
+     *  @private
+     *
      *  Load the error messages from the resource bundle.
      */
     override protected function resourcesChanged():void


Improved getSessionState() code for ignoring duplicate objects.

--- WeaveCore/src/weave/core/SessionManager.as
+++ WeaveCore/src/weave/core/SessionManager.as
@@ -354,6 +354,8 @@
 			objectCC.resumeCallbacks();
 		}

+		private const _getSessionStateIgnoreList:Dictionary = new Dictionary(true); // keeps track of which objects are currently being traversed
+
 		/**
 		 * @param linkableObject An object containing sessioned properties (sessioned objects may be nested).
 		 * @return An object containing the values from the sessioned properties.
@@ -366,80 +368,77 @@
 				return null;
 			}

-			var result:Object = internalGetSessionState(linkableObject, new Dictionary(true));
-			//trace("getSessionState " + getQualifiedClassName(sessionedObject).split("::")[1] + ObjectUtil.toString(result));
-			return result;
-		}
-
-		/**
-		 * This function is for internal use only.
-		 * @param sessionedObject An object containing sessioned properties (sessioned objects may be nested).
-		 * @param ignoreList A dictionary that keeps track of which objects this function has already traversed.
-		 * @return An object containing the values from the sessioned properties.
-		 */
-		private function internalGetSessionState(sessionedObject:ILinkableObject, ignoreList:Dictionary):Object
-		{
-			// use ignore list to prevent infinite recursion
-			ignoreList[sessionedObject] = true;
+			var result:Object = null;

 			// special cases (explicit session state)
-			if (sessionedObject is ILinkableVariable)
-				return (sessionedObject as ILinkableVariable).getSessionState();
-			if (sessionedObject is ILinkableCompositeObject)
-				return (sessionedObject as ILinkableCompositeObject).getSessionState();
-
-			// implicit session state
-			// first pass: get property names
-			var propertyNames:Array = getLinkablePropertyNames(sessionedObject);
-			var resultNames:Array = [];
-			var resultProperties:Array = [];
-			var property:ILinkableObject = null;
-			var i:int;
-			//trace("getting session state for "+getQualifiedClassName(sessionedObject),"propertyNames="+propertyNames);
-			for (i = 0; i < propertyNames.length; i++)
+			if (linkableObject is ILinkableVariable)
+			{
+				result = (linkableObject as ILinkableVariable).getSessionState();
+			}
+			else if (linkableObject is ILinkableCompositeObject)
 			{
-				var name:String = propertyNames[i];
-				try
-				{
-					property = null; // must set this to null first because accessing the property may fail
-					property = sessionedObject[name] as ILinkableObject;
-				}
-				catch (e:Error)
-				{
-					trace('SessionManager.internalGetSessionState(): Unable to get property "'+name+'" of class "'+getQualifiedClassName(sessionedObject)+'"',e.getStackTrace());
-				}
-				// first pass: set result[name] to the ILinkableObject
-				if (property != null && ignoreList[property] === undefined)
-				{
-					// skip this property if it was not registered as a linkable child of the sessionedObject.
-					if (childToParentDictionaryMap[property] === undefined || childToParentDictionaryMap[property][sessionedObject] === undefined)
-						continue;
-					// only include this property in the session state once
-					ignoreList[property] = true;
-					resultNames.push(name);
-					resultProperties.push(property);
-				}
-				else
-				{
-					//trace("skipped property",name,property,ignoreList[property]);
-				}
-			}
-			// special case if there are no child objects
-			if (resultNames.length == 0)
-				return null;
-			// second pass: get values from property names
-			var result:Object = new Object();
-			for (i = 0; i < resultNames.length; i++)
+				result = (linkableObject as ILinkableCompositeObject).getSessionState();
+			}
+			else
 			{
-				var value:Object = internalGetSessionState(resultProperties[i], ignoreList);
-				property = resultProperties[i] as ILinkableObject;
-				// do not include objects that have a null implicit session state (no child objects)
-				if (value == null && !(property is ILinkableVariable) && !(property is ILinkableCompositeObject))
-					continue;
-				result[resultNames[i]] = value;
-				//trace("getState",getQualifiedClassName(sessionedObject),resultNames[i],result[resultNames[i]]);
-			}
-			return result;
+				// implicit session state
+				// first pass: get property names
+				var propertyNames:Array = getLinkablePropertyNames(linkableObject);
+				var resultNames:Array = [];
+				var resultProperties:Array = [];
+				var property:ILinkableObject = null;
+				var i:int;
+				//trace("getting session state for "+getQualifiedClassName(sessionedObject),"propertyNames="+propertyNames);
+				for (i = 0; i < propertyNames.length; i++)
+				{
+					var name:String = propertyNames[i];
+					try
+					{
+						property = null; // must set this to null first because accessing the property may fail
+						property = linkableObject[name] as ILinkableObject;
+					}
+					catch (e:Error)
+					{
+						reportError('Unable to get property "'+name+'" of class "'+getQualifiedClassName(linkableObject)+'"');
+					}
+					// first pass: set result[name] to the ILinkableObject
+					if (property != null && !_getSessionStateIgnoreList[property])
+					{
+						// skip this property if it was not registered as a linkable child of the sessionedObject.
+						if (childToParentDictionaryMap[property] === undefined || childToParentDictionaryMap[property][linkableObject] === undefined)
+							continue;
+						// avoid infinite recursion in implicit session states
+						_getSessionStateIgnoreList[property] = true;
+						resultNames.push(name);
+						resultProperties.push(property);
+					}
+					else
+					{
+						if (property != null)
+							trace("ignoring duplicate object:",name,property);
+					}
+				}
+				// special case if there are no child objects -- return null
+				if (resultNames.length > 0)
+				{
+					// second pass: get values from property names
+					result = new Object();
+					for (i = 0; i < resultNames.length; i++)
+					{
+						var value:Object = getSessionState(resultProperties[i]);
+						property = resultProperties[i] as ILinkableObject;
+						// do not include objects that have a null implicit session state (no child objects)
+						if (value == null && !(property is ILinkableVariable) && !(property is ILinkableCompositeObject))
+							continue;
+						result[resultNames[i]] = value;
+						//trace("getState",getQualifiedClassName(sessionedObject),resultNames[i],result[resultNames[i]]);
+					}
+				}
+			}
+
+			_getSessionStateIgnoreList[linkableObject] = undefined;
+
+			return result;
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as
+++ frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 8741
Author:   jimurphy@adobe.com
Date:     2009-07-22T21:00:56.965677Z

Log Message:
-----------
Merged 3.x revisions 8623,8685,8740 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/mxml/IMXMLSupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/ISOAPDecoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/MessagePerformanceUtils.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as</path>

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

--- frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as
+++ frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as
@@ -30,8 +30,9 @@
 [ResourceBundle("rpc")]

 /**
- * The <mx:RemoteObject> tag gives you access to the methods of
- * Java objects using Action Message Format (AMF) encoding.
+ *  Use the <mx:RemoteObject> tag to represent an HTTPService object in an MXML file.
+ *  This tag gives you access to the methods of
+ *  Java objects using Action Message Format (AMF) encoding.

  * @mxml
  * <p>
@@ -91,9 +92,10 @@
     //--------------------------------------------------------------------------

     /**
-     * Create a new RemoteObject.
-     * @param destination the destination of the RemoteObject, should match a destination name
-     * in the services-config.xml file.
+     *  Create a new RemoteObject.
+     *
+     *  @param destination The destination of the RemoteObject, should match a destination name
+     *  in the services-config.xml file.
      *
      *  @langversion 3.0
      *  @playerversion Flash 9


Transferred from the Adobe Open Source Subversion Repository

Revision: 3248
Author:   gosmith@adobe.com
Date:     2008-09-17T22:58:26.587163Z

Log Message:
-----------
Updated to TCAL build 173. (Note: I did NOT update the players.)

The three TCAL SWCS used by Flex 4 are now named tcal_core.swc, tcal_conversion.swc, and tcal_edit.swc.

All TCAL APIs are now in a package named flashx.tcal. We are using flashx to indicate important APIs that are considered to extend the Flash platform but which live below application frameworks such as Flex.

On TextFlow, a new 'displayController' property replaces the old 'container' and 'controller' properties.

When importing, you use importToFlow() rather than importFromString() or importFromXML.

Reviewer: N/A
Bugs: -
QA: No
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Parser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/TextFlowComposer.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/libs/text_importExport.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/build.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/libs/tcal_conversion.swc</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/libs/tcal_edit.swc</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/libs/text_edit.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/events/TextOperationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/libs/tcal_core.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/utils/TextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/fxg-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/libs/text_model.swc</path>

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

--- frameworks/projects/spark/src/spark/events/TextOperationEvent.as
+++ frameworks/projects/spark/src/spark/events/TextOperationEvent.as
@@ -14,7 +14,7 @@

 import flash.events.Event;

-import text.operations.FlowOperation;
+import flashx.tcal.operations.FlowOperation;

 /**
  *  Represents events that are dispatched when text content


fixed other bug in SoundAnalyzer

fixed other bug in SoundAnalyzer

--- src/hype/framework/sound/SoundAnalyzer.as
+++ src/hype/framework/sound/SoundAnalyzer.as
@@ -80,7 +80,7 @@
 			var i:uint;
 			var value:Number = 0;
 			start = Math.max(0, start);
-			end = Math.min(255, end);
+			end = Math.min(256, end);

 			if (_invalid) {
 				computeSpectrum();


Added IconButton to Runner

Added IconButton to Runner

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4482 3e7533ad-8678-4d30-8e38-00a379d3f0d0

--- src/LAMLRunner.as
+++ src/LAMLRunner.as
@@ -3,7 +3,9 @@

 	import laml.display.Component;
 	import laml.display.HBox;
+	import laml.display.IconButton;
 	import laml.display.Label;
+	import laml.display.Row;
 	import laml.display.VBox;

 	public class LAMLRunner extends TestRunner {
@@ -11,7 +13,9 @@
 		private var hboxRef:HBox;
 		private var vboxRef:VBox;
 		private var componentRef:Component;
+		private var iconButtonRef:IconButton;
 		private var labelRef:Label;
+		private var rowRef:Row;

 		public function LAMLRunner() {
 			// start(clazz:Class, methodName:String, showTrace:Boolean)


saving, loading

saving, loading

--- src/LevelState.as
+++ src/LevelState.as
@@ -19,6 +19,7 @@
 	public class LevelState extends FlxState {

 		protected var tick:int;
+		protected var savedString:String;

 		public var lowerLayer:FlxGroup;
 		public var midLayer:FlxGroup;
@@ -72,6 +73,7 @@

 			for each (var module:Module in level.modules)
 				addModule(module);
+			load();

 			makeUI();
 		}
@@ -82,6 +84,15 @@
 			FlxG.state.add(upperLayer = new FlxGroup());
 		}

+		private function addWire(w:Wire, fixed:Boolean = true):void {
+			w.FIXED = fixed;
+			Wire.place(w);
+
+			var displayWire:DWire = new DWire(w);
+			midLayer.add(displayWire);
+			displayWires.push(displayWire);
+		}
+
 		private function addModule(m:Module, fixed:Boolean = true):void {
 			if (!m) return;

@@ -95,9 +106,22 @@
 		}

 		protected function makeUI():void {
+			makeBackButton();
+			makeSaveButton();
 			makeUndoButtons();
 			upperLayer.add(new DTime(FlxG.width / 2 - 50, 10));
 			upperLayer.add(new Scroller);
+		}
+
+		protected function makeBackButton():void {
+			var backButton:GraphicButton = new GraphicButton(90, 10, _back_sprite, function back():void { FlxG.switchState(new MenuState); }, new Key("ESCAPE"));
+			backButton.fades = true;
+			upperLayer.add(backButton);
+		}
+
+		protected function makeSaveButton():void {
+			var saveButton:GraphicButton = new GraphicButton(130, 10, _save_sprite, save, new Key("S"));
+			upperLayer.add(saveButton);
 		}

 		protected function makeUndoButtons():void {
@@ -287,6 +311,63 @@
 			return reactionStack.pop().execute();
 		}

+		protected function save():void {
+			savedString = genSaveString();
+			U.save.data[level.name] = savedString;
+			C.log(savedString);
+		}
+
+		protected function genSaveString():String {
+			var saveString:String = "";
+
+			//save modules
+			var modulesExist:Boolean;
+			for each (var module:Module in modules)
+				if (module.exists && !module.FIXED) {
+					saveString += module.saveString();
+					modulesExist = true;
+				}
+			saveString += U.SAVE_DELIM;
+			if (!modulesExist)
+				saveString += U.SAVE_DELIM;
+
+			//save wires
+			var wiresExist:Boolean;
+			for each (var wire:Wire in wires)
+				if (wire.exists) {
+					saveString += wire.saveString();
+					wiresExist = true;
+				}
+
+			saveString += U.SAVE_DELIM;
+			if (!wiresExist)
+				saveString += U.SAVE_DELIM;
+
+			return saveString;
+		}
+
+
+		protected function load():void {
+			var saveString:String = U.save.data[level.name];
+			if (!saveString)
+				return;
+
+			var saveArray:Array = saveString.split(U.SAVE_DELIM + U.SAVE_DELIM);
+
+			//load modules
+			var moduleStrings:String = saveArray[0];
+			if (moduleStrings.length)
+				for each (var moduleString:String in moduleStrings.split(U.SAVE_DELIM))
+					addModule(Module.fromString(moduleString), false);
+
+			//load wires
+			var wireStrings:String = saveArray[1];
+			if (wireStrings.length)
+				for each (var wireString:String in wireStrings.split(U.SAVE_DELIM))
+					addWire(Wire.fromString(wireString), false);
+
+			savedString = saveString;
+		}

 		protected const MODE_MODULE:int = 0;
 		protected const MODE_CONNECT:int = 1;


SuiteIterator now detects if a test class was passed instead of a suite.

--- as3/src/asunit4/framework/SuiteIterator.as
+++ as3/src/asunit4/framework/SuiteIterator.as
@@ -19,6 +19,9 @@
 		 * @return	An array of Class references.
 		 */
 		public static function getTestClasses(testSuite:Class):Array {
+			if (!isSuite(testSuite) && TestIterator.isTest(testSuite))
+				return [testSuite];
+
 			var typeInfo:XML = describeType(testSuite);
 			var testClasses:Array = [];
 			for each (var variableType:XML in typeInfo.factory[0].variable.@type) {


- fixed flex4 imaage map outline thickness by hardcoding thickness. Ugly fix, but will work for now

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

 package flexlib.controls
 {
-	import flash.display.Graphics;
-	import flash.display.SpreadMethod;
-	import flash.display.Sprite;
-	import flash.events.MouseEvent;
-
-	import flexlib.events.ImageMapEvent;
-
-	import mx.collections.ArrayCollection;
-	import mx.controls.Image;
-	import mx.core.UIComponent;
-	import mx.core.mx_internal;
-	import mx.styles.CSSStyleDeclaration;
-	import mx.styles.StyleManager;
-
-	use namespace mx_internal;
-
-	/**
-	 *  Thickness of the outline of each area.
-	 *
-	 *  @default 1
-	 */
-	[Style(name="outlineThickness", type="Number", format="Length", inherit="no")]
-
-	/**
-	 *  Color of the outline of each area.
-	 *
-	 *  @default 0xff0000
-	 */
-	[Style(name="outlineColor", type="uint", format="Color", inherit="no")]
-
-	/**
-	 *  Alpha transparency of the outline of each area. Default is 0 so the outlines are invisible.
-	 *
-	 *  @default 0
-	 */
-	[Style(name="outlineAlpha", type="Number", format="Length", inherit="no")]
-
-	/**
-	 *  Fill color of each area.
-	 *
-	 *  @default 0xff0000
-	 */
-	[Style(name="fillColor", type="uint", format="Color", inherit="no")]
-
-	/**
-	 *  Alpha transparency of the fill of each area. Default is 0 so the areas are invisible.
-	 *
-	 *  @default 0
-	 */
-	[Style(name="fillAlpha", type="Number", format="Length", inherit="no")]
-
-	/**
-	 * Fired when an area is clicked.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_CLICK
-	 */
-	[Event(name="shapeClick", type="flexlib.events.ImageMapEvent")]
-
-	/**
-	 * Fired when an area is double clicked.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_DOUBLECLICK
-	 */
-	[Event(name="shapeDoubleClick", type="flexlib.events.ImageMapEvent")]
-
-	/**
-	 * Fired when the mouse moves over an area.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_OVER
-	 */
-	[Event(name="shapeOver", type="flexlib.events.ImageMapEvent")]
-
-	/**
-	 * Fired when the mouse moves out of an area.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_OUT
-	 */
-	[Event(name="shapeOut", type="flexlib.events.ImageMapEvent")]
-
-	/**
-	 * Fired when the mouse is pressed down on an area.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_DOWN
-	 */
-	[Event(name="shapeDown", type="flexlib.events.ImageMapEvent")]
-
-	/**
-	 * Fired when the mouse is released on an area.
-	 *
-	 * @eventType flexlib.events.ImageMapEvent.SHAPE_UP
-	 */
-	[Event(name="shapeUp", type="flexlib.events.ImageMapEvent")]
-
-	[IconFile("ImageMap.png")]
-
-	/**
-	 * The ImageMap control is an implementation of a client-side image map component, like it is supported in HTML.
-	 *
ImageMap is an extension of the Image class, so you can specify the source attribute
-	 * just like you would for a standard Image component. The map property is used to define the actual
-	 * image map and all the area items that make up the map. The map property can be defined
-	 * either in MXML or by setting it with Actionscript.
-	 *

-	 *
-	 *
The intent is for you to be able to generate your image map in whatever program you use to create image maps,
-	 * and be able to cut and paste it into your MXML component with minimal changes.
-	 *

-	 *
-	 *
Example MXML usage:

-	 *
-	 *

-	 * <ImageMap xmlns="flexlib.controls.*"
-	 * 		source="usa.jpg"
-	 * 		showToolTips="true"
-	 * 		shapeClick="navigateToURL(new URLRequest(event.href), event.linkTarget)"
-	 * 		>
-	 *
-	 * 		<map>
-	 * 			<area alt="WA" shape="POLY" coords="85,11,133,11,134,42,114,42,100,47,96,45,91,48,83,40,76,40,75,29,70,23,71,18,82,20,87,18" href="http://en.wikipedia.org/wiki/Washington" target="_blank"/>
-	 * 			<area alt="OR" shape="POLY" coords="76,40,83,40,90,48,96,45,101,47,115,43,134,43,138,46,133,57,134,84,72,84,71,71,76,56" href="http://en.wikipedia.org/wiki/Oregon" target="_blank"/>
-	 * 		</map>
-	 *
-	 * </ImageMap>
-	 *

-	 *
-	 * @see http://www.w3.org/TR/html4/struct/objects.html#client-side-maps
-	 */
-	public class ImageMap extends Image
-	{
-		/**
-		 * @private
-		 * The array of area object that specifies all the areas we are going to draw.
-		 */
-		private var _map:Array;
-
-		/**
-		 * @private
-		 * The UIComponent that holds all the shapes we'll be drawing.
-		 */
-		private var areaHolder:UIComponent;
-
-		/**
-		 * Indicates whether tool tips should be shown for each area.
-		 *
-		 * @default false
-		 */
-		public var showToolTips:Boolean = false;
-
-		/**
-		 * Field of the <area /> item that will be used for the tooltip.
-		 * @default "alt"
-		 */
-		public var toolTipField:String = "alt";
-
-		/**
-		 * @private
-		 *
-		 * We initialize the default styles for outline and fill styles by calling
-		 * initStyles() when the component is instantiated.
-		 */
-		private static var stylesInitialised:Boolean = initStyles();
-
-		/**
-		 * @private
-		 *
-		 * The default styes are defined here.
-		 */
-		private static function initStyles():Boolean {
-			var sd:CSSStyleDeclaration =
-			StyleManager.getStyleDeclaration("ImageMap");
-
-			if (!sd)
-			{
-				sd = new CSSStyleDeclaration();
-				StyleManager.setStyleDeclaration("ImageMap", sd, false);
-			}
-
-			sd.defaultFactory = function():void
-			{
-				this.outlineColor = 0xff0000;
-				this.outlineAlpha = 1;
-				this.outlineThickness = 1;
-				this.fillColor = 0xff0000;
-				this.fillAlpha = 0;
-			}
-			return true;
-		}
-
-		override protected function createChildren():void {
-			super.createChildren();
-
-			areaHolder = new UIComponent();
-
-			this.addChild(areaHolder);
-		}
-
-		/**
-		 * The <map /> HTML block that is normally used for the image map in an HTML file.
-		 * This should be wrapped as an XMLList and can either be cuopy/pasted straight into the MXML
-		 * file, or set via Actionscript.
-		 */
-		public function set map(value:Array):void {
-			_map = value;
-
-			invalidateDisplayList();
-		}
-
-		/**
-		 * @private
-		 */
-		public function get map():Array {
-			return _map;
-		}
-
-		/**
-		 * @private
-		 *
-		 * Draws each of the areas as a UIComponent. UIComponent is used (as opposed to Sprite) so we
-		 * can get the useHandCursor and toolTip functionality. Each shape is drawn and
-		 * added to the areaHolder component.
-		 */
-		private function drawShapes():void {
-			removeChildren();
-
-			var outlineThickness:Number = getStyle("outlineThickness");
-			var outlineColor:uint = getStyle("outlineColor");
-			var outlineAlpha:Number = getStyle("outlineAlpha");
-			var fillColor:uint = getStyle("fillColor");
-			var fillAlpha:Number = getStyle("fillAlpha");
-
-
-			for each(var item:area in _map) {
-				var shape:String = item.shape;
-				//we split up the coordinates into an Array. The coords are in the format 23,56,34,57,89,...
-				var coords:Array = item.coords.split(",");
-
-				var sprite:UIComponent = new UIComponent();
-
-				sprite.addEventListener(MouseEvent.CLICK, sprite_clickHandler, false, 0, true);
-				sprite.addEventListener(MouseEvent.DOUBLE_CLICK, sprite_dblclickHandler, false, 0, true);
-				sprite.addEventListener(MouseEvent.MOUSE_DOWN, sprite_downHandler, false, 0, true);
-				sprite.addEventListener(MouseEvent.MOUSE_OUT, sprite_outHandler, false, 0, true);
-				sprite.addEventListener(MouseEvent.MOUSE_OVER, sprite_overHandler, false, 0, true);
-				sprite.addEventListener(MouseEvent.MOUSE_UP, sprite_upHandler, false, 0, true);
-
-				sprite.useHandCursor = this.useHandCursor;
-				sprite.buttonMode = true;
-
-				if(showToolTips) {
-					sprite.toolTip = item[toolTipField];
-				}
-
-
-				var g:Graphics = sprite.graphics;
-				g.lineStyle(outlineThickness, outlineColor, outlineAlpha);
-				g.beginFill(fillColor, fillAlpha);
-
-				switch(shape.toLowerCase()) {
-					case "rect":
-						g.drawRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
-						break;
-					case "poly":
-						drawPoly(g, coords);
-						break;
-					case "circle":
-						g.drawCircle(coords[0], coords[1], coords[2]);
-						break;
-				}
-
-				g.endFill();
-
-				areaHolder.addChild(sprite);
-			}
-		}
-
-		/*
-		 * After we finish drawing we make sure that the areaHolder is on top of our loaded image.
-		 * If we don't have the call to setChildIndex then the shapes will all be under the image.
-		 *
-		 * We set the x and y scale of the areaHolder to match the content, since we might be
-		 * scaling the content to fit the size of this Image component. We also implement the clipping
-		 * of the shapes by using the content's scrollRect boundaries.
-		 */
-		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
-			super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-			if(contentHolder) {
-				areaHolder.scaleX = contentHolder.scaleX;
-				areaHolder.scaleY = contentHolder.scaleY;
-				areaHolder.scrollRect = contentHolder.scrollRect;
-			}
-
-			drawShapes();
-
-			//without this the shapes would get stuck underneath the main loaded content
-			setChildIndex(areaHolder, numChildren - 1);
-		}
-
-		/**
-		 * @private
-		 * Simple utility function to draw a polygon from an array of points.
-		 */
-		private function drawPoly(g:Graphics, coords:Array):void {
-			g.moveTo(coords[0], coords[1]);
-
-			//since we moved to the first point, we loop over all points starting on the second point
-			for(var i:int=2; i<coords.length; i+=2) {
-				g.lineTo(coords[i], coords[i+1]);
-			}
-
-			//got to remember to reconnect from the last point to the first point
-			g.lineTo(coords[0], coords[1]);
-		}
-
-		/**
-		 * @private
-		 * I don't know why UIComponent doesn't have a removeAllChildren() method, but this
-		 * method just does that, removes all children of the areaHolder.
-		 */
-		private function removeChildren():void {
-			while(areaHolder.numChildren > 0) {
-				areaHolder.removeChildAt(0);
-			}
-		}
-
-		/**
-		 * @private
-		 * We're basically re-creating the functionality of all the mouse events. But we need
-		 * to dispatch our custom ImageMapEvent so we can pass back the link information as well
-		 * as the basic mouse event info. So I've recreated the click, double-click, down, up, over,
-		 * and out mouse events.
-		 */
-		private function sprite_clickHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_CLICK);
-		}
-
-		/**
-		 * @private
-		 */
-		private function sprite_dblclickHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_DOUBLECLICK);
-		}
-
-		/**
-		 * @private
-		 */
-		private function sprite_downHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_DOWN);
-		}
-
-		/**
-		 * @private
-		 */
-		private function sprite_upHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_UP);
-		}
-
-		/**
-		 * @private
-		 */
-		private function sprite_overHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_OVER);
-		}
-
-		/**
-		 * @private
-		 */
-		private function sprite_outHandler(event:MouseEvent):void {
-			var sprite:UIComponent = event.currentTarget as UIComponent;
-			doDispatchEvent(sprite, ImageMapEvent.SHAPE_OUT);
-		}
-
-		/**
-		 * @private
-		 *
-		 * This lets us dispatch one of these ImageMapEvents. Basically we need to figure
-		 * out which shape was clicked, and when we dispatch the event we reference the href link
-		 * for that shape, and we also pass back the entire XML item for that shape. This is because
-		 * someone might want to use this component for something other than the standard image map linking
-		 * scenario. Passing back the XML item should give maximum flexibility.
-		 */
-		private function doDispatchEvent(sprite:UIComponent, type:String):void {
-			if(sprite.parent != areaHolder) return;
-
-			var index:int = areaHolder.getChildIndex(sprite);
-			var item:area = _map[index];
-
-			var target:String = "";
-			if(item.target) {
-				target = item.target;
-			}
-
-			var href:String = "";
-			if(item.href) {
-				href = item.href;
-			}
-			dispatchEvent(new ImageMapEvent(type, false, false, href, item, target));
-		}
-	}
+  import flash.display.Graphics;
+  import flash.display.SpreadMethod;
+  import flash.display.Sprite;
+  import flash.events.MouseEvent;
+
+  import flexlib.events.ImageMapEvent;
+
+  import mx.collections.ArrayCollection;
+  import mx.controls.Image;
+  import mx.core.UIComponent;
+  import mx.core.mx_internal;
+  import mx.styles.CSSStyleDeclaration;
+  import mx.styles.StyleManager;
+
+  use namespace mx_internal;
+
+  /**
+   *  Thickness of the outline of each area.
+   *
+   *  @default 1
+   */
+  [Style(name="outlineThickness", type="Number", format="Length", inherit="no")]
+
+  /**
+   *  Color of the outline of each area.
+   *
+   *  @default 0xff0000
+   */
+  [Style(name="outlineColor", type="uint", format="Color", inherit="no")]
+
+  /**
+   *  Alpha transparency of the outline of each area. Default is 0 so the outlines are invisible.
+   *
+   *  @default 0
+   */
+  [Style(name="outlineAlpha", type="Number", format="Length", inherit="no")]
+
+  /**
+   *  Fill color of each area.
+   *
+   *  @default 0xff0000
+   */
+  [Style(name="fillColor", type="uint", format="Color", inherit="no")]
+
+  /**
+   *  Alpha transparency of the fill of each area. Default is 0 so the areas are invisible.
+   *
+   *  @default 0
+   */
+  [Style(name="fillAlpha", type="Number", format="Length", inherit="no")]
+
+  /**
+   * Fired when an area is clicked.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_CLICK
+   */
+  [Event(name="shapeClick", type="flexlib.events.ImageMapEvent")]
+
+  /**
+   * Fired when an area is double clicked.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_DOUBLECLICK
+   */
+  [Event(name="shapeDoubleClick", type="flexlib.events.ImageMapEvent")]
+
+  /**
+   * Fired when the mouse moves over an area.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_OVER
+   */
+  [Event(name="shapeOver", type="flexlib.events.ImageMapEvent")]
+
+  /**
+   * Fired when the mouse moves out of an area.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_OUT
+   */
+  [Event(name="shapeOut", type="flexlib.events.ImageMapEvent")]
+
+  /**
+   * Fired when the mouse is pressed down on an area.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_DOWN
+   */
+  [Event(name="shapeDown", type="flexlib.events.ImageMapEvent")]
+
+  /**
+   * Fired when the mouse is released on an area.
+   *
+   * @eventType flexlib.events.ImageMapEvent.SHAPE_UP
+   */
+  [Event(name="shapeUp", type="flexlib.events.ImageMapEvent")]
+
+  [IconFile("ImageMap.png")]
+
+  /**
+   * The ImageMap control is an implementation of a client-side image map component, like it is supported in HTML.
+   *
ImageMap is an extension of the Image class, so you can specify the source attribute
+   * just like you would for a standard Image component. The map property is used to define the actual
+   * image map and all the area items that make up the map. The map property can be defined
+   * either in MXML or by setting it with Actionscript.
+   *

+   *
+   *
The intent is for you to be able to generate your image map in whatever program you use to create image maps,
+   * and be able to cut and paste it into your MXML component with minimal changes.
+   *

+   *
+   *
Example MXML usage:

+   *
+   *

+   * <ImageMap xmlns="flexlib.controls.*"
+   * 		source="usa.jpg"
+   * 		showToolTips="true"
+   * 		shapeClick="navigateToURL(new URLRequest(event.href), event.linkTarget)"
+   * 		>
+   *
+   * 		<map>
+   * 			<area alt="WA" shape="POLY" coords="85,11,133,11,134,42,114,42,100,47,96,45,91,48,83,40,76,40,75,29,70,23,71,18,82,20,87,18" href="http://en.wikipedia.org/wiki/Washington" target="_blank"/>
+   * 			<area alt="OR" shape="POLY" coords="76,40,83,40,90,48,96,45,101,47,115,43,134,43,138,46,133,57,134,84,72,84,71,71,76,56" href="http://en.wikipedia.org/wiki/Oregon" target="_blank"/>
+   * 		</map>
+   *
+   * </ImageMap>
+   *

+   *
+   * @see http://www.w3.org/TR/html4/struct/objects.html#client-side-maps
+   */
+  public class ImageMap extends Image
+  {
+    /**
+     * @private
+     * The array of area object that specifies all the areas we are going to draw.
+     */
+    private var _map:Array;
+
+    /**
+     * @private
+     * The UIComponent that holds all the shapes we'll be drawing.
+     */
+    private var areaHolder:UIComponent;
+
+    /**
+     * Indicates whether tool tips should be shown for each area.
+     *
+     * @default false
+     */
+    public var showToolTips:Boolean = false;
+
+    /**
+     * Field of the <area /> item that will be used for the tooltip.
+     * @default "alt"
+     */
+    public var toolTipField:String = "alt";
+
+    /**
+     * @private
+     *
+     * We initialize the default styles for outline and fill styles by calling
+     * initStyles() when the component is instantiated.
+     */
+    private static var stylesInitialised:Boolean = initStyles();
+
+    /**
+     * @private
+     *
+     * The default styes are defined here.
+     */
+    private static function initStyles():Boolean
+    {
+      var sd:CSSStyleDeclaration =
+        StyleManager.getStyleDeclaration("ImageMap");
+
+      if (!sd)
+      {
+        sd = new CSSStyleDeclaration();
+        StyleManager.setStyleDeclaration("ImageMap", sd, false);
+      }
+
+      sd.defaultFactory = function():void
+      {
+        this.outlineColor = 0xff0000;
+        this.outlineAlpha = 1;
+        this.outlineThickness = 1;
+        this.fillColor = 0xff0000;
+        this.fillAlpha = 0;
+      }
+      return true;
+    }
+
+    public function ImageMap()
+    {
+      super();
+    }
+
+    override protected function createChildren():void
+    {
+      super.createChildren();
+
+      areaHolder = new UIComponent();
+
+      this.addChild(areaHolder);
+    }
+
+    /**
+     * The <map /> HTML block that is normally used for the image map in an HTML file.
+     * This should be wrapped as an XMLList and can either be cuopy/pasted straight into the MXML
+     * file, or set via Actionscript.
+     */
+    public function set map(value:Array):void
+    {
+      _map = value;
+
+      invalidateDisplayList();
+    }
+
+    /**
+     * @private
+     */
+    public function get map():Array
+    {
+      return _map;
+    }
+
+    /**
+     * @private
+     *
+     * Draws each of the areas as a UIComponent. UIComponent is used (as opposed to Sprite) so we
+     * can get the useHandCursor and toolTip functionality. Each shape is drawn and
+     * added to the areaHolder component.
+     */
+    private function drawShapes():void
+    {
+      removeChildren();
+
+      FLEX_TARGET_VERSION::flex4
+      {
+        //TODO: this shouldn't be hardcoded...
+        // for some reason, flex4 won't pickup the outlineThickness style,
+        // fixing with a hardcoded thickness of 1 for now.
+        var outlineThickness:Number = 1;
+      }
+      FLEX_TARGET_VERSION::flex3
+      {
+        var outlineThickness:Number = getStyle("outlineThickness");
+      }
+
+      var outlineColor:uint = getStyle("outlineColor");
+      var outlineAlpha:Number = getStyle("outlineAlpha");
+      var fillColor:uint = getStyle("fillColor");
+      var fillAlpha:Number = getStyle("fillAlpha");
+
+
+      for each (var item:area in _map)
+      {
+        var shape:String = item.shape;
+        //we split up the coordinates into an Array. The coords are in the format 23,56,34,57,89,...
+        var coords:Array = item.coords.split(",");
+
+        var sprite:UIComponent = new UIComponent();
+
+        sprite.addEventListener(MouseEvent.CLICK, sprite_clickHandler, false, 0, true);
+        sprite.addEventListener(MouseEvent.DOUBLE_CLICK, sprite_dblclickHandler, false, 0, true);
+        sprite.addEventListener(MouseEvent.MOUSE_DOWN, sprite_downHandler, false, 0, true);
+        sprite.addEventListener(MouseEvent.MOUSE_OUT, sprite_outHandler, false, 0, true);
+        sprite.addEventListener(MouseEvent.MOUSE_OVER, sprite_overHandler, false, 0, true);
+        sprite.addEventListener(MouseEvent.MOUSE_UP, sprite_upHandler, false, 0, true);
+
+        sprite.useHandCursor = this.useHandCursor;
+        sprite.buttonMode = true;
+
+        if (showToolTips)
+        {
+          sprite.toolTip = item[toolTipField];
+        }
+
+
+        var g:Graphics = sprite.graphics;
+        g.lineStyle(outlineThickness, outlineColor, outlineAlpha);
+        g.beginFill(fillColor, fillAlpha);
+
+        switch (shape.toLowerCase())
+        {
+          case "rect":
+            g.drawRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
+            break;
+          case "poly":
+            drawPoly(g, coords);
+            break;
+          case "circle":
+            g.drawCircle(coords[0], coords[1], coords[2]);
+            break;
+        }
+
+        g.endFill();
+
+        areaHolder.addChild(sprite);
+      }
+    }
+
+    /*
+     * After we finish drawing we make sure that the areaHolder is on top of our loaded image.
+     * If we don't have the call to setChildIndex then the shapes will all be under the image.
+     *
+     * We set the x and y scale of the areaHolder to match the content, since we might be
+     * scaling the content to fit the size of this Image component. We also implement the clipping
+     * of the shapes by using the content's scrollRect boundaries.
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+      super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+      if (contentHolder)
+      {
+        areaHolder.scaleX = contentHolder.scaleX;
+        areaHolder.scaleY = contentHolder.scaleY;
+        areaHolder.scrollRect = contentHolder.scrollRect;
+      }
+
+      drawShapes();
+
+      //without this the shapes would get stuck underneath the main loaded content
+      setChildIndex(areaHolder, numChildren - 1);
+    }
+
+    /**
+     * @private
+     * Simple utility function to draw a polygon from an array of points.
+     */
+    private function drawPoly(g:Graphics, coords:Array):void
+    {
+      g.moveTo(coords[0], coords[1]);
+
+      //since we moved to the first point, we loop over all points starting on the second point
+      for (var i:int = 2; i < coords.length; i += 2)
+      {
+        g.lineTo(coords[i], coords[i + 1]);
+      }
+
+      //got to remember to reconnect from the last point to the first point
+      g.lineTo(coords[0], coords[1]);
+    }
+
+    /**
+     * @private
+     * I don't know why UIComponent doesn't have a removeAllChildren() method, but this
+     * method just does that, removes all children of the areaHolder.
+     */
+    private function removeChildren():void
+    {
+      while (areaHolder.numChildren > 0)
+      {
+        areaHolder.removeChildAt(0);
+      }
+    }
+
+    /**
+     * @private
+     * We're basically re-creating the functionality of all the mouse events. But we need
+     * to dispatch our custom ImageMapEvent so we can pass back the link information as well
+     * as the basic mouse event info. So I've recreated the click, double-click, down, up, over,
+     * and out mouse events.
+     */
+    private function sprite_clickHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_CLICK);
+    }
+
+    /**
+     * @private
+     */
+    private function sprite_dblclickHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_DOUBLECLICK);
+    }
+
+    /**
+     * @private
+     */
+    private function sprite_downHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_DOWN);
+    }
+
+    /**
+     * @private
+     */
+    private function sprite_upHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_UP);
+    }
+
+    /**
+     * @private
+     */
+    private function sprite_overHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_OVER);
+    }
+
+    /**
+     * @private
+     */
+    private function sprite_outHandler(event:MouseEvent):void
+    {
+      var sprite:UIComponent = event.currentTarget as UIComponent;
+      doDispatchEvent(sprite, ImageMapEvent.SHAPE_OUT);
+    }
+
+    /**
+     * @private
+     *
+     * This lets us dispatch one of these ImageMapEvents. Basically we need to figure
+     * out which shape was clicked, and when we dispatch the event we reference the href link
+     * for that shape, and we also pass back the entire XML item for that shape. This is because
+     * someone might want to use this component for something other than the standard image map linking
+     * scenario. Passing back the XML item should give maximum flexibility.
+     */
+    private function doDispatchEvent(sprite:UIComponent, type:String):void
+    {
+      if (sprite.parent != areaHolder)
+        return;
+
+      var index:int = areaHolder.getChildIndex(sprite);
+      var item:area = _map[index];
+
+      var target:String = "";
+      if (item.target)
+      {
+        target = item.target;
+      }
+
+      var href:String = "";
+      if (item.href)
+      {
+        href = item.href;
+      }
+      dispatchEvent(new ImageMapEvent(type, false, false, href, item, target));
+    }
+  }
 }


added check for null path and fixed wrong param passed to getObject() recursive call

--- WeaveJS/src/weavejs/core/SessionManager.as
+++ WeaveJS/src/weavejs/core/SessionManager.as
@@ -1125,6 +1125,8 @@

 		public function getObject(root:ILinkableObject, path:Array):ILinkableObject
 		{
+			if (!path)
+				return null;
 			var object:ILinkableObject = root;
 			for (var i:int = 0; i < path.length; i++)
 			{
@@ -1150,7 +1152,7 @@
 				else
 				{
 					if (object is ILinkableObjectWithNewPaths || JS.hasProperty(object, DEPRECATED_PATH_REWRITE))
-						return getObject(root, object[DEPRECATED_PATH_REWRITE](path.slice(i)));
+						return getObject(object, object[DEPRECATED_PATH_REWRITE](path.slice(i)));
 					if (object is ILinkableObjectWithNewProperties || JS.hasProperty(object, DEPRECATED_STATE_MAPPING))
 						return getObjectFromDeprecatedPath(object[DEPRECATED_STATE_MAPPING], path, i);
 					return null;