Transferred from the Adobe Open Source Subversion Repository

Revision: 5914
Author:   jimurphy@adobe.com
Date:     2009-04-03T19:51:17.243500Z

Log Message:
-----------
Merge i11.5 revisions 5871-5872,5883,5885,5902 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build.xml</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/flex-config.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/states/statefulNodes.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/i11.5/frameworks/mxml-2009-manifest.xml" copyfrom-rev="5902" action="A">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/Grammar.jj</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/air-config.xml</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/airframework/spark-air-manifest.xml</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/halo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" copyfrom-path="/flex/sdk/branches/i11.5/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as" copyfrom-rev="5902" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>

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

--- frameworks/projects/spark/src/spark/effects/Scale.as
+++ frameworks/projects/spark/src/spark/effects/Scale.as
@@ -13,7 +13,7 @@
 {
 import mx.effects.IEffectInstance;

-import spark.effects.effectClasses.AnimateTransformInstance;
+import spark.effects.supportClasses.AnimateTransformInstance;

 /**
  * This class is a utility wrapper around the AnimateTransform effect, exposing the


Abjectscript is just such a great language. I fixed two bugs in here that the
compiler never wanted to tell me about.
- I was trying to store read values into the streamer itself, referecing
  it as "this[ii]". This turns out to be legal, even though the class is
  sealed, because you can access public fields using the [] operator with
  a string argument. At runtime, ii == 0, it got Stringdafied to "0" and
  then a field called "0" was looked up on the class and oh no, it didn't
  exist.
- Worse, I had a line that referenced "length" instead of "arr.length".
  There is no length defined in the class, nor is there one in the superclass.
  It turns out the base class Object has an undocumented constant called
  length that seems to always be 0. Isn't that special?

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

--- src/as/com/threerings/io/streamers/ArrayStreamer.as
+++ src/as/com/threerings/io/streamers/ArrayStreamer.as
@@ -133,7 +133,7 @@
         } else if (_isFinal) {
             var mask :ArrayMask = new ArrayMask();
             mask.readFrom(ins);
-            for (ii = 0; ii < length; ii++) {
+            for (ii = 0; ii < arr.length; ii++) {
                 if (mask.isSet(ii)) {
                     var target :Object;
                     if (_delegate == null) {
@@ -142,7 +142,7 @@
                         target = _delegate.createObject(ins);
                     }
                     ins.readBareObjectImpl(target, _delegate);
-                    this[ii] = target;
+                    arr[ii] = target;
                 }
             }


expose the AmbidextrousList scrollBarOnLeft property

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

--- src/as/com/threerings/flex/PlayerList.as
+++ src/as/com/threerings/flex/PlayerList.as
@@ -67,6 +67,16 @@
         _players.sort = sort;
     }

+    public function get scrollBarOnLeft () :Boolean
+    {
+        return _list.scrollBarOnLeft;
+    }
+
+    public function set scrollBarOnLeft (onLeft :Boolean) :void
+    {
+        _list.scrollBarOnLeft = onLeft;
+    }
+
     public function clear () :void
     {
         _values.clear();


--- test/Test.as
+++ test/Test.as
@@ -75,6 +75,7 @@
 			test(t2)

 			const t3:TestAllTypes = new TestAllTypes
+			t3.optionalString = "111foo"
 			t3.defaultNestedEnum = NestedEnum.FOO
 			t3.repeatedNestedMessage.push(new NestedMessage)
 			t3.repeatedNestedMessage.push(new NestedMessage)


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as
+++ frameworks/projects/spark/src/spark/filters/GradientGlowFilter.as
@@ -1,4 +1,4 @@
-package mx.filters
+package spark.filters
 {
 	import flash.filters.BitmapFilter;
 	import flash.filters.GradientGlowFilter;


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package spark.formatters
 {


added check for null returned from deprecatedPathRewrite()

--- WeaveJS/src/weavejs/core/SessionManager.as
+++ WeaveJS/src/weavejs/core/SessionManager.as
@@ -1152,7 +1152,11 @@
 				else
 				{
 					if (object is ILinkableObjectWithNewPaths || JS.hasProperty(object, DEPRECATED_PATH_REWRITE))
-						return getObject(object, object[DEPRECATED_PATH_REWRITE](path.slice(i)));
+					{
+						var rewrittenPath:Array = object[DEPRECATED_PATH_REWRITE](path.slice(i));
+						if (rewrittenPath)
+							return getObject(object, rewrittenPath);
+					}
 					if (object is ILinkableObjectWithNewProperties || JS.hasProperty(object, DEPRECATED_STATE_MAPPING))
 						return getObjectFromDeprecatedPath(object[DEPRECATED_STATE_MAPPING], path, i);
 					return null;


fixed bugs handling undefined params

fixed bugs handling undefined params

--- WeaveJS/src/weavejs/core/SessionManager.as
+++ WeaveJS/src/weavejs/core/SessionManager.as
@@ -1251,6 +1251,12 @@

 		public function computeDiff(oldState:Object, newState:Object):*
 		{
+			// convert undefined params to null params
+			if (oldState == null)
+				oldState = null;
+			if (newState == null)
+				newState = null;
+
 			var type:String = typeof(oldState); // the type of null is 'object'
 			var diffValue:*;

@@ -1391,7 +1397,7 @@
 				// find new properties
 				for (var newName:String in newState)
 				{
-					if (oldState[newName] === undefined)
+					if (oldState[newName] === undefined && newState[newName] !== undefined)
 					{
 						if (!diff)
 							diff = {};
@@ -1405,6 +1411,12 @@

 		public function combineDiff(baseDiff:Object, diffToAdd:Object):Object
 		{
+			// convert undefined params to null params
+			if (baseDiff == null)
+				baseDiff = null;
+			if (diffToAdd == null)
+				diffToAdd = null;
+
 			var baseType:String = typeof(baseDiff); // the type of null is 'object'
 			var diffType:String = typeof(diffToAdd);

@@ -1491,7 +1503,7 @@
 					while (i--)
 					{
 						var value:Object = diffToAdd[i];
-						if (value === null || typeof value != 'object')
+						if (value == null || typeof value != 'object')
 							baseDiff[i] = value; // avoid function call overhead
 						else
 							baseDiff[i] = combineDiff(baseDiff[i], value);


Change 20080606-maxcarlson-f by maxcarlson@Roboto on 2008-06-06 12:32:34 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix stretches with setResource()

Bugs Fixed: LPP-4975 - Image stretch fails after number of setSource() calls

Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)

Details: Refactor all sprite sizing logic to updateResourceSize() method.  updateResourceSize() ensures the height and width get properly reset when a resource is attached.

Tests: See LPP-4975.  mousing over the left image, and clicking on the right image repeatedly works in swf7/8 and dhtml.  demos/lzpix/app.lzx runs as before in swf 7 and 8.

git-svn-id: d62bde4b5aa582fdf07c8d403e53e0399a7ed285@9503 fa20e4f9-1d0a-0410-b5f3-dc9c16b8b17c

--- WEB-INF/lps/lfc/kernel/swf/LzSprite.as
+++ WEB-INF/lps/lfc/kernel/swf/LzSprite.as
@@ -309,6 +309,7 @@
     }

     this.resource = resourceName;
+    this.updateResourceSize(true);
 }

@@ -382,18 +383,6 @@
         this.checkPlayStatus();
     }

-    //@field Number resourcewidth: The width of the resource that
-    //this view attached
-    //@field Number resourceheight: The height of the resource that this
-    //view attached
-    var rt = canvas.resourcetable[ mcID ];
-    if ( rt ){
-        this.resourcewidth = rt.width;
-        this.resourceheight = rt.height;
-    } else {
-        this.resourcewidth = mc._width;
-        this.resourceheight = mc._height;
-    }
     //unrolled this loop because it is called frequently
     if (this.x != 0) this.setX(this.x);
     if (this.y != 0) this.setY(this.y);
@@ -405,8 +394,7 @@
     } else if ( this.owner.visibility != "collapse" ){
         this.__LZmovieClipRef._visible = this.visible;
     }
-    // only send onload if we have a resource
-    this.owner.resourceload({width: this.resourcewidth, height: this.resourceheight, resource: this.resource, skiponload: this.__LZhaser});
+    this.updateResourceSize();
 }

 /**
@@ -744,12 +732,21 @@
   * (before the load started) and what we really want is the size of
   * the loaded resource.
   */
-LzSprite.prototype.updateResourceSize = function ( ){
-    var mc = this.__LZmovieClipRef;
-    // Get the true size by unscaling. Note: clip scale is in percent
-    this.resourcewidth = mc._width/(mc._xscale/100);
-    this.resourceheight = mc._height/(mc._yscale/100);
-    this.owner.resourceload({width: this.resourcewidth, height: this.resourceheight, resource: this.resource, skiponload: true});
+LzSprite.prototype.updateResourceSize = function (skipsend){
+    var mc = this.getMCRef();
+    this.setWidth(this.hassetwidth?this.width:null);
+    this.setHeight(this.hassetheight?this.height:null);
+    var rt = canvas.resourcetable[ this.resource ];
+    if ( rt ){
+        this.resourcewidth = rt.width;
+        this.resourceheight = rt.height;
+    } else {
+        // Get the true size by unscaling. Note: clip scale is in percent
+        this.resourcewidth = mc._width/(mc._xscale/100);
+        this.resourceheight = mc._height/(mc._yscale/100);
+    }
+
+    if (! skipsend) this.owner.resourceload({width: this.resourcewidth, height: this.resourceheight, resource: this.resource, skiponload: true});
 }

 /**


- added another reset method

- added another reset method

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

--- src/reprise/controls/RadioButtonGroup.as
+++ src/reprise/controls/RadioButtonGroup.as
@@ -60,6 +60,17 @@
 		public function removeRadioButton(btn:RadioButton):void
 		{
 			m_radioButtons.splice(m_radioButtons.indexOf(btn), 1);
+		}
+
+		public function reset():void
+		{
+			super.reset();
+			for (var i:int = 0; i < m_radioButtons.length; i++)
+			{
+				var rbtn:RadioButton = m_radioButtons[i] as RadioButton;
+				rbtn.setSelected(false);
+			}
+			m_selectedIndex = -1;
 		}

 		public function setRadioButtonSelected(btn:RadioButton, bFlag:Boolean):void


Added support for constructor parameters in ClassUtils.getNewInstance

Change-Id: Id759f7a8bc6b47fc41129e3e7f1dc8debfc70696

--- WeaveCore/src/weave/core/ClassUtils.as
+++ WeaveCore/src/weave/core/ClassUtils.as
@@ -184,12 +184,29 @@
 		 * Returns a new instance of a class.
 		 *
 		 * @param classQName The qualified name of the class.
+		 * @param params Parameters to pass to the constructor of the class.
 		 * @return A new instance of the class.
 		 */
-		public static function getNewInstance(classQName:String):Object
+		public static function getNewInstance(classQName:String, params:Array = null):Object
 		{
 			var classDef:Class = getClassDefinition(classQName);
-			return new classDef();
+			if (!params)
+				return new classDef();
+			switch (params.length)
+			{
+				case 0: return new classDef();
+				case 1: return new classDef(params[0]);
+				case 2: return new classDef(params[0], params[1]);
+				case 3: return new classDef(params[0], params[1], params[2]);
+				case 4: return new classDef(params[0], params[1], params[2], params[3]);
+				case 5: return new classDef(params[0], params[1], params[2], params[3], params[4]);
+				case 6: return new classDef(params[0], params[1], params[2], params[3], params[4], params[5]);
+				case 7: return new classDef(params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
+				case 8: return new classDef(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]);
+				case 9: return new classDef(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8]);
+				case 10: return new classDef(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9]);
+				default: throw new Error("Too many constructor parameters (maximum 10)");
+			}
 		}
 		/*
 		private function typeEquals(o:*, cls:Class):Boolean


clean: fixed issue where clean did not work with default Apache Royale output folder (references BowlerHatLLC/vscode-as3mxml#314)

--- src/ASConfigC.as
+++ src/ASConfigC.as
@@ -748,7 +748,26 @@
 			{
 				return;
 			}
+
 			var outputDirectory:String = findOutputDirectory(this._mainFile, this._outputPath, !this._outputIsJS);
+			if(this._outputIsJS)
+			{
+				var debugOutputDir:String = path.join(outputDirectory, "bin", "js-debug");
+				this.cleanOutputDirectory(debugOutputDir);
+				var releaseOutputDir:String = path.join(outputDirectory, "bin", "js-release");
+				this.cleanOutputDirectory(releaseOutputDir);
+			}
+			else //swf
+			{
+				this.cleanOutputDirectory(outputDirectory);
+			}
+
+			//immediately exits after cleaning
+			process.exit(0);
+		}
+
+		private function cleanOutputDirectory(outputDirectory:String):void
+		{
 			var cwd:String = process.cwd();
 			if(folderContains(outputDirectory, cwd))
 			{
@@ -795,9 +814,6 @@
 					process.exit(1);
 				}
 			}
-
-			//immediately exits after cleaning
-			process.exit(0);
 		}

 		private function compileProject():void


Change:	37603

Change:	37603

User:	jsundman

Description:
	Summary: documentation only -- small typo
	Technical Reviewer: na
	Bugs Fixed: LPP-852
	New Features: na
	QA Reviewer: ant doc
	Doc Reviewer: moi

git-svn-id: d62bde4b5aa582fdf07c8d403e53e0399a7ed285@64 fa20e4f9-1d0a-0410-b5f3-dc9c16b8b17c


For testing purposes compare float values using 7 digits of precision

--- test/acceptance/shell.as
+++ test/acceptance/shell.as
@@ -228,6 +228,14 @@
             passed = "true";
         }
         }
+        // If both objects are float, check that the values are the same
+        // within 7 digits of precision.
+        // log_10(2^24) ie 24 bits gives 7.2 digits of decimal precision
+        if (typeof(actual) == "float" && typeof(expect) == "float") {
+            if ( float.abs(actual-expect) < 0.000001 ) {
+                passed = "true";
+            }
+        }
     }
     return passed;
 }


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 12457
Author:   smgilson@adobe.com
Date:     2009-12-03T18:13:50.586970Z

Log Message:
-----------
asdoc updates for localization

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/AnimateTransform3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/animation/Keyframe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/AnchorStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/Wipe.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/IEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.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/spark/src/spark/effects/AnimateTransform.as</path>

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

--- frameworks/projects/framework/src/mx/effects/IEffect.as
+++ frameworks/projects/framework/src/mx/effects/IEffect.as
@@ -223,7 +223,7 @@
      *  The effect target is responsible for the hiding the focus ring.
      *  Subclasses of the UIComponent class hide the focus ring automatically.
      *  If the effect target is not a subclass of the UIComponent class,
-     *  you must add functionality to it to hide the focus ring.
+     *  add functionality to it to hide the focus ring.
      *
      *
Set this property to true
      *  to hide the focus ring during the effect.

@@ -429,12 +429,12 @@

     /**
      *  Returns an Array of Strings, where each String is the name
-     *  of a property that is changed by this effect.
+     *  of a property changed by this effect.
      *  For example, the Move effect returns an Array that contains
      *  "x" and "y".
      *
      *
Every subclass of Effect must implement this method.
-     *  The method is used by the EffectManager
+     *  The EffectManager uses this method
      *  to ensure that no two effects are trying to animate
      *  the same property of the same object at the same time.

      *
@@ -480,7 +480,7 @@
      *
      *
Calling the createInstance() method
      *  does not play the effect.
-     *  You must call the startEffect() method
+     *  Call the startEffect() method
      *  on the returned effect instance.

      *
      *
This function is automatically called by the
@@ -559,7 +559,7 @@
      *
For mask effects, the mask is not removed automatically
      *  when the effect is stopped.
      *  Running further mask effects on the same target(s)
-     *  without first removing the mask may produce unexpected results.

+     *  without first removing the mask can produce unexpected results.

      *
      *  @langversion 3.0
      *  @playerversion Flash 9
@@ -652,10 +652,10 @@
      *  Captures the current values of the relevant properties
      *  of an additional set of targets
      *
-     *
This function is used by Flex when a data change
+     *
Flex uses this function when a data change
      *  effect is run.

      *
-     *  @param targets Array of targets for which values will be captured
+     *  @param targets Array of targets for which values are captured
      *
      *  @langversion 3.0
      *  @playerversion Flash 9


Transferred from the Adobe Open Source Subversion Repository

Revision: 3698
Author:   gpburch@adobe.com
Date:     2008-10-16T22:11:24.788232Z

Log Message:
-----------
Removed references to ArrayList and ArrayCollection and instead used IList. This optimized the HScrollbar only case by nearly 75k. I also removed some frivolous casting.

QE: No
Doc: No
Checkintests: Pass
Reviewer: Glen
Bugs: None

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as

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

--- frameworks/projects/framework/src/mx/states/AddItems.as
+++ frameworks/projects/framework/src/mx/states/AddItems.as
@@ -14,8 +14,7 @@
 import flash.display.DisplayObject;
 import mx.components.FxContainer;
 import mx.components.Group;
-import mx.collections.ArrayCollection;
-import mx.collections.ArrayList;
+import mx.collections.IList;
 import mx.core.Container;
 import mx.core.ContainerCreationPolicy;
 import mx.core.IDeferredInstance;
@@ -389,7 +388,7 @@
         {
             addItemsToContainer(dest as Container, localItems);
         }
-        else if (propertyName != null && !isStyle && dest[propertyName] is ArrayCollection)
+        else if (propertyName != null && !isStyle && dest[propertyName] is IList)
         {
             addItemsToArrayCollection(dest[propertyName], localItems);
         }
@@ -431,9 +430,9 @@
             for (i = 0; i < numAdded; i++)
                 Container(dest).removeChildAt(startIndex);
         }
-        else if (propertyName != null && !isStyle && dest[propertyName] is ArrayCollection)
-        {
-            removeItemsFromArrayCollection(dest[propertyName] as ArrayCollection);
+        else if (propertyName != null && !isStyle && dest[propertyName] is IList)
+        {
+            removeItemsFromArrayCollection(dest[propertyName] as IList);
         }
         else
         {
@@ -468,8 +467,8 @@
             if (propertyName == null && dest is Container)
                 return Container(dest).getChildIndex(DisplayObject(object));

-            if (propertyName != null && !isStyle && dest[propertyName] is ArrayCollection)
-                return ArrayList(dest[propertyName].list).getItemIndex(object);
+            if (propertyName != null && !isStyle && dest[propertyName] is IList)
+                return IList(dest[propertyName].list).getItemIndex(object);

             if (propertyName != null && isStyle)
                 return dest.getStyle(propertyName).indexOf(object);
@@ -549,10 +548,8 @@
     /**
      *  @private
      */
-    protected function addItemsToArrayCollection(dest:ArrayCollection, items:Array):void
+    protected function addItemsToArrayCollection(list:IList, items:Array):void
     {
-        var list:ArrayList = ArrayList(dest.list);
-
         if (startIndex == -1)
             startIndex = list.length;

@@ -563,10 +560,8 @@
     /**
      *  @private
      */
-    protected function removeItemsFromArrayCollection(dest:ArrayCollection):void
-    {
-        var list:ArrayList = ArrayList(dest.list);
-
+    protected function removeItemsFromArrayCollection(list:IList):void
+    {
         for (var i:int = 0; i < numAdded; i++)
             list.removeItemAt(startIndex);


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

--- frameworks/projects/mx/src/mx/effects/AddChildAction.as
+++ frameworks/projects/mx/src/mx/effects/AddChildAction.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: 10075
Author:   rfrishbe@adobe.com
Date:     2009-09-09T01:01:58.077369Z

Log Message:
-----------
Cleanups from the spark text changes and some bug fixes for VideoElement.  Also some PARB changes for UIComponent.

TitleBar: Changing the skin part type from Label to Textbase

UIComponent: skipMeasure()->canSkipMeasurement() to be in line with GraphicElement.  This has been PARB approved.
UIComponent: same with hasComplexLayoutMatrix...this replaces hasDeltaIdentityTransform.  This has been PARB approved.

StyleProtoChain: cleanup around what interfaces to use

TextBase: clean up code that’s no longer needed.

VideoElement: Fixing 4 bugs:
SDK-22824: sourceLastPlayed keeps track of what video file we’ve called play() with last.  This way if a user pauses the video and wants to start it up again at the same point, we can call play(null) on the underlying FLVPlayback videoPlayer.  However, anytime the souce changes, we want to null out sourceLastPlayed.  This was causing a bug when someone set the source to null and then reset it to it’s previous value.

SDK-23034 (GUMBO_PRIORITY): This deals with some FLVPlayback quirks around sizing.  I had put in a fix so we weren’t setting width/height on the underlying videoPlayer too many times, but apparently we need to make sure it always gets called once.  Hopefully when switching to Strobe we can cleanup this logic...I put a FIXME in to do this.

SDK-21947/ SDK-22533 - some video files don’t always send out a metadata event.  I’m not quite sure why this is, but in case this happens, we do a check in the ready handler to see whether we should call invalidateSize() to make sure it gets sized properly.

QE notes:-
Doc notes:-
Bugs: SDK-22824, SDK-23034, SDK-21947, SDK-22533
Reviewer: Glenn, Corey
Tests run: checkintests, Button, GraphicTags, VideoElement, and VideoPlayer (some VideoPlayer were failing, but I think it should be fine)
Is noteworthy for integration: Yes

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/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Skin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/components/windowClasses/TitleBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/RemoveActionInstance.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/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/effects/supportClasses/AnimateTransformInstance.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/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as</path>

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

--- frameworks/projects/spark/src/mx/core/UIFTETextField.as
+++ frameworks/projects/spark/src/mx/core/UIFTETextField.as
@@ -2156,7 +2156,7 @@
 		// we need to map "auto" and "on" to true
 		// and "off" to false for Halo components
 		// here and in TLFTextField.
-		// For Spark components, SimpleText and CSSTextLayoutFormat,
+		// For Spark components, Label and CSSTextLayoutFormat,
 		// do the opposite mapping of true to "on" and false to "off".
 		// We also support a value of "default"
 		// (which we set in the global selector)


Transferred from the Adobe Open Source Subversion Repository

Revision: 3149
Author:   gruehle@adobe.com
Date:     2008-09-08T23:58:35.368231Z

Log Message:
-----------
Fix bugs introduced by the display object sharing optimization. This checkin should fix ordering problems when dynamically adding/removing graphic elements, and ordering problems when changing graphic element properties that require a display object (rotation, alpha, filters, etc).

Bugs:
MXMLG-219: BitmapGraphic component content always rendered from 0, 0 origin.
MXMLG-220: setting visible property of Rect and Ellipse does nothing.
MXMLG-222: setting the alpha of a rectangle changes z-order when there are 3 or more rectangles
SDK-16754: Z-order incorrect when a Group is present

QA: Yes - the test files from these bugs (or something equivalent) should be added to our standard test suite
Reviewer: Deepa

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/BitmapGraphic.as</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -864,7 +864,7 @@

         itemAdded(item, index);

-        assignDisplayObjects(index);
+        assignDisplayObjects();

         return item;
     }
@@ -908,7 +908,7 @@
             }
         }

-        assignDisplayObjects(index);
+        assignDisplayObjects();

         return item;
     }
@@ -1233,7 +1233,7 @@
                 else if (index == 0)
                     insertIndex = 0;
                 else
-                    insertIndex = index -1;
+                    insertIndex = index;

                 super.setChildIndex(child, insertIndex);
                 return child;


Transferred from the Adobe Open Source Subversion Repository

Revision: 16331
Author:   jszeto@adobe.com
Date:     2010-05-27T00:20:51.292460Z

Log Message:
-----------
Form Bug Fixes

SDK-26517 - Form should take into account includeInLayout property when calculating baselineElementPosition

Added logic into Group to find the first element that has includeInLayout == true.

SDK-26509 - Spark Form shows dual error strings in non-stacked layout

Removed error string from FormSkin. Created a StackedFormSKin skin which includes the error string.

SDK-26499 - Spark Form skin should use errorStringDisplay skin part instead of errorStringText

Changed name to errorTextDisplay

SDK-26498 - Spark Form needs more padding around error strings

Added padding to the entire Form

SDK-26503 - Difficult to create custom Spark FormItem skin due to embedded required/error icon assets

Added new requiredIndicatorSource and errorIndicatorSource styles to FormItem. FormItem skins now grab the icons from these styles. Custom skin also have access to these icons.

QE notes: Form layout has changed
Doc notes: none
Bugs: SDK-26517, SDK-26509, SDK-26499, SDK-26498, SDK-26503
Reviewer: Kevin
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/assets/ErrorIndicator.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/build.xml</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/spark/src/spark/skins/spark/StackedFormItemSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormItemSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/StackedFormHeadingSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormHeadingSkin.mxml</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/spark/assets</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/build_framework.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/assets/RequiredIndicator.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/FormTestScript.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/assets/ErrorIndicator.png</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/assets/RequiredIndicator.png</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/FormItem.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/StackedFormSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/FormSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -232,8 +232,19 @@
         var bElement:IVisualElement = baselinePositionElement;

         // If no baselinePositionElement is specified, use the first element
-        if (bElement == null && numElements > 0)
-            bElement = getElementAt(0);
+        if (bElement == null)
+        {
+            for (var i:int = 0; i < numElements; i++)
+            {
+                var elt:IVisualElement = getElementAt(i);
+                if (elt.includeInLayout)
+                {
+                    bElement = elt;
+                    break;
+                }
+            }
+        }
+

         if (bElement)
             return bElement.baselinePosition + bElement.y;


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/components/Label.as
+++ frameworks/projects/spark/src/spark/components/Label.as
@@ -9,7 +9,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.graphics
+package spark.primitives
 {

 import flash.display.DisplayObjectContainer;
@@ -29,7 +29,7 @@
 import flash.text.engine.TextLineValidity;

 import mx.core.mx_internal;
-import mx.graphics.baseClasses.TextGraphicElement;
+import spark.primitives.supportClasses.TextGraphicElement;

 [DefaultProperty("text")]

@@ -40,31 +40,31 @@
 include "../styles/metadata/BasicTextLayoutFormatStyles.as"
 include "../styles/metadata/NonInheritingTextLayoutFormatStyles.as"

-[IconFile("TextBox.png")]
+[IconFile("SimpleText.png")]

 /**
  *  A box, specified in the parent Group element's coordinate space, that contains text.
  *
- *
The TextBox class is similar to the mx.controls.Label control, although it can display
+ *
The SimpleText class is similar to the mx.controls.Label control, although it can display
  *  multiple lines.

  *
- *
TextBox does not support drawing a background or border; it only renders text. It supports only the basic formatting styles.
- *  If you want to use more advanced formatting styles, use the TextGraphic or TextView control.

+ *
SimpleText does not support drawing a background or border; it only renders text. It supports only the basic formatting styles.
+ *  If you want to use more advanced formatting styles, use the RichText or RichEditableText control.

  *
  *
The specified text is wrapped at the right edge of the component's bounds. If it extends below the bottom, it is clipped.
  *  The display cannot be scrolled.

  *
- *  @see mx.components.TextView
- *  @see mx.graphics.TextGraphic
+ *  @see mx.components.RichEditableText
+ *  @see mx.graphics.RichText
  *
- *  @includeExample examples/TextBoxExample.mxml
+ *  @includeExample examples/SimpleTextExample.mxml
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class TextBox extends TextGraphicElement
+public class SimpleText extends TextGraphicElement
 {
     include "../core/Version.as";

@@ -145,7 +145,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function TextBox()
+    public function SimpleText()
     {
         super();
     }
@@ -218,14 +218,14 @@
 	/**
 	 *  @private
 	 *  Creates an ElementFormat (and its FontDescription)
-	 *  based on the TextBox's CSS styles.
+	 *  based on the SimpleText's CSS styles.
 	 *  These must be recreated each time because FTE
 	 *  does not allow them to be reused.
 	 */
 	private function createElementFormat():ElementFormat
 	{
-		// When you databind to a text formatting style on a TextBox,
-		// as in <TextBox fontFamily="{fontCombo.selectedItem}"/>
+		// When you databind to a text formatting style on a SimpleText,
+		// as in <SimpleText fontFamily="{fontCombo.selectedItem}"/>
 		// the databinding can cause the style to be set to null.
 		// Setting null values for properties in an FTE FontDescription
 		// or ElementFormat throw an error, so the following code does


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package spark.effects
 {


added initialize parameter to LinkablePromise.fromIterativeTask().

--- WeaveCore/src/weave/core/LinkablePromise.as
+++ WeaveCore/src/weave/core/LinkablePromise.as
@@ -39,19 +39,21 @@
 	{
 		/**
 		 * Creates a LinkablePromise from an iterative task function.
-		 * @param asyncTask A function which is designed to be called repeatedly across multiple frames until it returns a value of 1.
+		 * @param initialize A function that should be called prior to starting the iterativeTask.
+		 * @param iterativeTask A function which is designed to be called repeatedly across multiple frames until it returns a value of 1.
 		 * @param priority The task priority, which should be one of the static constants in WeaveAPI.
 		 * @param description A description of the task as a String, or a function to call which returns a descriptive string.
 		 * Such a function has the signature function():String.
 		 * @see weave.api.core.IStageUtils#startTask()
 		 */
-		public static function fromIterativeTask(iterativeTask:Function, priority:uint, description:* = null, validateNow:Boolean = false):LinkablePromise
+		public static function fromIterativeTask(initialize:Function, iterativeTask:Function, priority:uint, description:* = null, validateNow:Boolean = false):LinkablePromise
 		{
 			var promise:LinkablePromise;
 			var asyncToken:AsyncToken;

 			function asyncStart():AsyncToken
 			{
+				initialize();
 				WeaveAPI.StageUtils.startTask(promise, iterativeTask, priority, asyncComplete);
 				return asyncToken = new AsyncToken();
 			}


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

--- frameworks/projects/framework/src/mx/graphics/GradientStroke.as
+++ frameworks/projects/framework/src/mx/graphics/GradientStroke.as
@@ -10,6 +10,11 @@
  *  @see mx.graphics.Stroke
  *  @see mx.graphics.GradientEntry
  *  @see flash.display.Graphics
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class GradientStroke extends GradientBase
 {
@@ -70,6 +75,11 @@
      *  thickness of 10 pixels, the miter is cut off at 25 pixels.
      *  This parameter is optional,
      *  with a default value of 0.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function GradientStroke(weight:Number = 1,
                                      pixelHinting:Boolean = false,
@@ -111,6 +121,11 @@
      *  CapsStyle.ROUND.

      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get caps():String
     {
@@ -155,6 +170,11 @@
      *  JoinStyle.ROUND.

      *
      *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get joints():String
     {
@@ -206,6 +226,11 @@
      *  the miter is cut off at 25 pixels.

      *
      *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get miterLimit():Number
     {
@@ -252,6 +277,11 @@
      *  disjoints can appear for curves and straight lines.

      *
      *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get pixelHinting():Boolean
     {
@@ -313,6 +343,11 @@
      *

      *
      *  @default LineScaleMode.NORMAL
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get scaleMode():String
     {
@@ -349,6 +384,11 @@

     /**
      *  The stroke weight, in pixels.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get weight():Number
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

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

 package mx.managers
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
+++ frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as
@@ -0,0 +1,1073 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+import flash.events.IEventDispatcher;
+import flash.events.TimerEvent;
+import flash.system.ApplicationDomain;
+import flash.system.SecurityDomain;
+import flash.utils.Timer
+import flash.utils.describeType;
+import mx.core.FlexVersion;
+import mx.core.mx_internal;
+import mx.events.ModuleEvent;
+import mx.events.StyleEvent;
+import mx.managers.SystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.modules.IModuleInfo;
+import mx.modules.ModuleManager
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.styles.IStyleModule;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+[ResourceBundle("styles")]
+
+/**
+ *  @private
+ */
+public class StyleManagerImpl implements IStyleManager2
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Set of inheriting non-color styles.
+     *  This is not the complete set from CSS.
+     *  Some of the omitted we don't support at all,
+     *  others may be added later as needed.
+     *  The isInheritingTextFormatStyle() method queries this set.
+     */
+    private static var inheritingTextFormatStyles:Object =
+    {
+        align: true,
+        bold: true,
+        color: true,
+        font: true,
+        indent: true,
+        italic: true,
+        size: true
+    };
+
+    /**
+     *  @private
+     *  Set of styles for which setStyle() causes
+     *  invalidateSize() to be called on the component.
+     *  The method registerSizeInvalidatingStyle() adds to this set
+     *  and isSizeInvalidatingStyle() queries this set.
+     */
+    private static var sizeInvalidatingStyles:Object =
+    {
+        borderStyle: true,
+        borderThickness: true,
+        fontAntiAliasType: true,
+        fontFamily: true,
+        fontGridFitType: true,
+        fontSharpness: true,
+        fontSize: true,
+        fontStyle: true,
+        fontThickness: true,
+        fontWeight: true,
+        headerHeight: true,
+        horizontalAlign: true,
+        horizontalGap: true,
+        kerning: true,
+        leading: true,
+        letterSpacing: true,
+        paddingBottom: true,
+        paddingLeft: true,
+        paddingRight: true,
+        paddingTop: true,
+        strokeWidth: true,
+        tabHeight: true,
+        tabWidth: true,
+        verticalAlign: true,
+        verticalGap: true
+    }
+
+    /**
+     *  @private
+     *  Set of styles for which setStyle() causes
+     *  invalidateSize() to be called on the component's parent.
+     *  The method registerParentSizeInvalidatingStyle() adds to this set
+     *  and isParentSizeInvalidatingStyle() queries this set.
+     */
+    private static var parentSizeInvalidatingStyles:Object =
+    {
+        bottom: true,
+        horizontalCenter: true,
+        left: true,
+        right: true,
+        top: true,
+        verticalCenter: true,
+        baseline: true
+    }
+
+    /**
+     *  @private
+     *  Set of styles for which setStyle() causes
+     *  invalidateDisplayList() to be called on the component's parent.
+     *  The method registerParentDisplayListInvalidatingStyle() adds to this set
+     *  and isParentDisplayListInvalidatingStyle() queries this set.
+     */
+    private static var parentDisplayListInvalidatingStyles:Object =
+    {
+        bottom: true,
+        horizontalCenter: true,
+        left: true,
+        right: true,
+        top: true,
+        verticalCenter: true,
+        baseline: true
+    }
+
+    /**
+     *  @private
+     *  Set of color names.
+     *  The method registerColorName() adds to this set
+     *  and isColorName() queries this set.
+     *  All color names in this set are lowercase in order to support
+     *  case-insensitive mapping in the StyleManager methods getColorName(),
+     *  getColorNames(), registerColorName(), and isColorName().
+     *  We handle color names at runtime in a case-insensitive way
+     *  because the MXML compiler does this at compile time,
+     *  in conformance with the CSS spec.
+     */
+    private static var colorNames:Object =
+    {
+        transparent: "transparent",
+        black: 0x000000,
+        blue: 0x0000FF,
+        green: 0x008000,
+        gray: 0x808080,
+        silver: 0xC0C0C0,
+        lime: 0x00FF00,
+        olive: 0x808000,
+        white: 0xFFFFFF,
+        yellow: 0xFFFF00,
+        maroon: 0x800000,
+        navy: 0x000080,
+        red: 0xFF0000,
+        purple: 0x800080,
+        teal: 0x008080,
+        fuchsia: 0xFF00FF,
+        aqua: 0x00FFFF,
+        magenta: 0xFF00FF,
+        cyan: 0x00FFFF,
+
+        // IMPORTANT: Theme colors must also be updated
+        // in the Flex compiler's CSS parser
+        // (in \src\java\macromedia\css\Descriptor.java)
+        // and possibly other places as well. Grep for them!
+        halogreen: 0x80FF4D,
+        haloblue: 0x009DFF,
+        haloorange: 0xFFB600,
+        halosilver: 0xAECAD9
+    };
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static var instance:IStyleManager2;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    public static function getInstance():IStyleManager2
+    {
+        if (!instance)
+            instance = new StyleManagerImpl();
+
+        return instance;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    public function StyleManagerImpl()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  A map of CSS selectors -- such as "global", "Button", and ".bigRed" --
+     *  to CSSStyleDeclarations.
+     *  This collection is accessed via getStyleDeclaration(),
+     *  setStyleDeclaration(), and clearStyleDeclaration().
+     */
+    private var _selectors:Object = {};
+
+    /**
+     *  @private
+     */
+    private var styleModules:Object = {};
+
+	/**
+	 *  @private
+	 *  Used for accessing localized Error messages.
+	 */
+	private var resourceManager:IResourceManager =
+									ResourceManager.getInstance();
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  stylesRoot
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _stylesRoot:Object;
+
+    /**
+     *  @private
+     *  The root of all proto chains used for looking up styles.
+     *  This object is initialized once by initProtoChainRoots() and
+     *  then updated by calls to setStyle() on the global CSSStyleDeclaration.
+     *  It is accessed by code that needs to construct proto chains,
+     *  such as the initProtoChain() method of UIComponent.
+     */
+    public function get stylesRoot():Object
+    {
+        return _stylesRoot;
+    }
+    public function set stylesRoot(value:Object):void
+    {
+        _stylesRoot = value;
+    }
+
+    //----------------------------------
+    //  inheritingStyles
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _inheritingStyles:Object = {};
+
+    /**
+     *  @private
+     *  Set of inheriting non-color styles.
+     *  This is not the complete set from CSS.
+     *  Some of the omitted we don't support at all,
+     *  others may be added later as needed.
+     *  The method registerInheritingStyle() adds to this set
+     *  and isInheritingStyle() queries this set.
+     */
+    public function get inheritingStyles():Object
+    {
+        return _inheritingStyles;
+    }
+    public function set inheritingStyles(value:Object):void
+    {
+        _inheritingStyles = value;
+    }
+
+    //----------------------------------
+    //  typeSelectorCache
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _typeSelectorCache:Object = {};
+
+    /**
+     *  @private
+     */
+    public function get typeSelectorCache():Object
+    {
+        return _typeSelectorCache;
+    }
+    public function set typeSelectorCache(value:Object):void
+    {
+        _typeSelectorCache = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  This method is called by code autogenerated by the MXML compiler,
+     *  after StyleManager.styles is popuplated with CSSStyleDeclarations.
+     */
+    public function initProtoChainRoots():void
+    {
+		// Prior to version 3, textDecoration and leading were not inheriting styles
+		if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+		{
+			delete _inheritingStyles["textDecoration"];
+			delete _inheritingStyles["leading"];
+		}
+
+		if (!stylesRoot)
+			stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
+    }
+
+    /**
+     *  @review
+     *  Returns an array of strings of all CSS selectors registered with the StyleManager.
+     *  Pass items in this array to the getStyleDeclaration function to get the corresponding CSSStyleDeclaration.
+     *  Note that class selectors are prepended with a period.
+     *
+     *  @return An array of all of the selectors
+     */
+    public function get selectors():Array
+    {
+    	var theSelectors:Array = [];
+    	for (var i:String in _selectors)
+    		theSelectors.push(i);
+
+    	return theSelectors;
+    }
+
+    /**
+     *  Gets the CSSStyleDeclaration object that stores the rules
+     *  for the specified CSS selector.
+     *
+     *
If the selector parameter starts with a period (.),
+     *  the returned CSSStyleDeclaration is a class selector and applies only to those instances
+     *  whose styleName property specifies that selector
+     *  (not including the period).
+     *  For example, the class selector ".bigMargins"
+     *  applies to any UIComponent whose styleName
+     *  is "bigMargins".

+     *
+     *
If the selector parameter does not start with a period,
+     *  the returned CSSStyleDeclaration is a type selector and applies to all instances
+     *  of that type.
+     *  For example, the type selector "Button"
+     *  applies to all instances of Button and its subclasses.

+     *
+     *
The global selector is similar to a type selector
+     *  and does not start with a period.

+     *
+     *  @param selector The name of the CSS selector.
+     *
+     *  @return The style declaration whose name matches the selector property.
+     */
+    public function getStyleDeclaration(
+                                selector:String):CSSStyleDeclaration
+    {
+        // If we were passed a type selector with a package name,
+        // such as "mx.controls.Button", strip off the package name
+        // leaving just "Button" and look for that selector.
+        if (selector.charAt(0) != ".")
+        {
+            var index:int = selector.lastIndexOf(".");
+            if (index != -1)
+                selector = selector.substr(index + 1);
+        }
+
+        return _selectors[selector];
+    }
+
+    /**
+     *  Sets the CSSStyleDeclaration object that stores the rules
+     *  for the specified CSS selector.
+     *
+     *
If the selector parameter starts with a period (.),
+     *  the specified selector is a class selector and applies only to those instances
+     *  whose styleName property specifies that selector
+     *  (not including the period).
+     *  For example, the class selector ".bigMargins"
+     *  applies to any UIComponent whose styleName
+     *  is "bigMargins".

+     *
+     *
If the selector parameter does not start with a period,
+     *  the specified selector is a "type selector" and applies to all instances
+     *  of that type.
+     *  For example, the type selector "Button"
+     *  applies to all instances of Button and its subclasses.

+     *
+     *
The global selector is similar to a type selector
+     *  and does not start with a period.

+     *
+     *  @param selector The name of the CSS selector.
+     *  @param styleDeclaration The new style declaration.
+     *  @param update Set to true to force an immediate update of the styles.
+     *  Set to false to avoid an immediate update of the styles in the application.
+     *  The styles will be updated the next time this method or the clearStyleDeclaration() method
+     *  is called with the update property set to true.
+     */
+    public function setStyleDeclaration(
+                                selector:String,
+                                styleDeclaration:CSSStyleDeclaration,
+                                update:Boolean):void
+    {
+        styleDeclaration.selectorRefCount++;
+
+        _selectors[selector] = styleDeclaration;
+
+        // Flush cache and start over.
+        typeSelectorCache = {};
+
+        if (update)
+            styleDeclarationsChanged();
+    }
+
+    /**
+     *  Clears the CSSStyleDeclaration object that stores the rules
+     *  for the specified CSS selector.
+     *
+     *
If the specified selector is a class selector (for example, ".bigMargins" or ".myStyle"),
+     *  you must be sure to start the
+     *  selector property with a period (.).

+     *
+     *
If the specified selector is a type selector (for example, "Button"), do not start the
+     *  selector property with a period.

+     *
+     *
The global selector is similar to a type selector
+     *  and does not start with a period.

+     *
+     *  @param selector The name of the CSS selector to clear.
+     *  @param update Set to true to force an immediate update of the styles.
+     *  Set to false to avoid an immediate update of the styles in the application.
+     *  The styles will be updated the next time this method or the setStyleDeclaration() method is
+     *  called with the update property set to true.
+     */
+    public function clearStyleDeclaration(selector:String,
+                                                 update:Boolean):void
+    {
+        var styleDeclaration:CSSStyleDeclaration =
+            getStyleDeclaration(selector);
+
+        if (styleDeclaration && styleDeclaration.selectorRefCount > 0)
+            styleDeclaration.selectorRefCount--;
+
+        delete _selectors[selector];
+
+        if (update)
+            styleDeclarationsChanged();
+    }
+
+    /**
+     *  @private
+     *  After an entire selector is added, replaced, or removed,
+     *  this method updates all the DisplayList trees.
+     */
+    public function styleDeclarationsChanged():void
+    {
+        var sms:Array /* of SystemManager */ =
+            SystemManagerGlobals.topLevelSystemManagers;
+        var n:int = sms.length;
+        for (var i:int = 0; i < n; i++)
+        {
+        	// Type as Object to avoid dependency on SystemManager or WindowedSystemManager
+            var sm:Object = sms[i];
+            sm.regenerateStyleCache(true);
+            sm.notifyStyleChangeInChildren(null, true);
+        }
+    }
+
+    /**
+     *  Adds to the list of styles that can inherit values
+     *  from their parents.
+     *
+     *
Note: Ensure that you avoid using duplicate style names, as name
+     *  collisions can result in decreased performance if a style that is
+     *  already used becomes inheriting.

+     *
+     *  @param styleName The name of the style that is added to the list of styles that can inherit values.
+     */
+    public function registerInheritingStyle(styleName:String):void
+    {
+        inheritingStyles[styleName] = true;
+    }
+
+    /**
+     *  Tests to see if a style is inheriting.
+     *
+     *  @param styleName The name of the style that you test to see if it is inheriting.
+     *
+     *  @return Returns true if the specified style is inheriting.
+     */
+    public function isInheritingStyle(styleName:String):Boolean
+    {
+        return inheritingStyles[styleName] == true;
+    }
+
+    /**
+     *  Test to see if a TextFormat style is inheriting.
+     *
+     *  @param styleName The name of the style that you test to see if it is inheriting.
+     *
+     *  @return Returns true if the specified TextFormat style
+     *  is inheriting.
+     */
+    public function isInheritingTextFormatStyle(styleName:String):Boolean
+    {
+        return inheritingTextFormatStyles[styleName] == true;
+    }
+
+    /**
+     *  Adds to the list of styles which may affect the measured size
+     *  of the component.
+     *  When one of these styles is set with setStyle(),
+     *  the invalidateSize() method is automatically called on the component
+     *  to make its measured size get recalculated later.
+     *
+     *  @param styleName The name of the style that you add to the list.
+     */
+    public function registerSizeInvalidatingStyle(styleName:String):void
+    {
+        sizeInvalidatingStyles[styleName] = true;
+    }
+
+    /**
+     *  Tests to see if a style changes the size of a component.
+     *
+     *
When one of these styles is set with the setStyle() method,
+     *  the invalidateSize() method is automatically called on the component
+     *  to make its measured size get recalculated later.

+     *
+     *  @param styleName The name of the style to test.
+     *
+     *  @return Returns true if the specified style is one
+     *  which may affect the measured size of the component.
+     */
+    public function isSizeInvalidatingStyle(styleName:String):Boolean
+    {
+        return sizeInvalidatingStyles[styleName] == true;
+    }
+
+    /**
+     *  Adds to the list of styles which may affect the measured size
+     *  of the component's parent container.
+     *
When one of these styles is set with setStyle(),
+     *  the invalidateSize() method is automatically called on the component's
+     *  parent container to make its measured size get recalculated
+     *  later.

+     *
+     *  @param styleName The name of the style to register.
+     */
+    public function registerParentSizeInvalidatingStyle(styleName:String):void
+    {
+        parentSizeInvalidatingStyles[styleName] = true;
+    }
+
+    /**
+     *  Tests to see if the style changes the size of the component's parent container.
+     *
+     *
When one of these styles is set with setStyle(),
+     *  the invalidateSize() method is automatically called on the component's
+     *  parent container to make its measured size get recalculated
+     *  later.

+     *
+     *  @param styleName The name of the style to test.
+     *
+     *  @return Returns true if the specified style is one
+     *  which may affect the measured size of the component's
+     *  parent container.
+     */
+    public function isParentSizeInvalidatingStyle(styleName:String):Boolean
+    {
+        return parentSizeInvalidatingStyles[styleName] == true;
+    }
+
+    /**
+     *  Adds to the list of styles which may affect the appearance
+     *  or layout of the component's parent container.
+     *  When one of these styles is set with setStyle(),
+     *  the invalidateDisplayList() method is auomatically called on the component's
+     *  parent container to make it redraw and/or relayout its children.
+     *
+     *  @param styleName The name of the style to register.
+     */
+    public function registerParentDisplayListInvalidatingStyle(
+                                styleName:String):void
+    {
+        parentDisplayListInvalidatingStyles[styleName] = true;
+    }
+
+    /**
+     *  Tests to see if this style affects the component's parent container in
+     *  such a way as to require that the parent container redraws itself when this style changes.
+     *
+     *
When one of these styles is set with setStyle(),
+     *  the invalidateDisplayList() method is auomatically called on the component's
+     *  parent container to make it redraw and/or relayout its children.

+     *
+     *  @param styleName The name of the style to test.
+     *
+     *  @return Returns true if the specified style is one
+     *  which may affect the appearance or layout of the component's
+     *  parent container.
+     */
+    public function isParentDisplayListInvalidatingStyle(
+                                styleName:String):Boolean
+    {
+        return parentDisplayListInvalidatingStyles[styleName] == true;
+    }
+
+    /**
+     *  Adds a color name to the list of aliases for colors.
+     *
+     *  @param colorName The name of the color to add to the list; for example, "blue".
+     *  If you later access this color name, the value is not case-sensitive.
+     *
+     *  @param colorValue Color value, for example, 0x0000FF.
+     */
+    public function registerColorName(colorName:String, colorValue:uint):void
+    {
+        colorNames[colorName.toLowerCase()] = colorValue;
+    }
+
+    /**
+     *  Tests to see if the given String is an alias for a color value. For example,
+     *  by default, the String "blue" is an alias for 0x0000FF.
+     *
+     *  @param colorName The color name to test. This parameter is not case-sensitive.
+     *
+     *  @return Returns true if colorName is an alias
+     *  for a color.
+     */
+    public function isColorName(colorName:String):Boolean
+    {
+        return colorNames[colorName.toLowerCase()] !== undefined;
+    }
+
+    /**
+     *  Returns the numeric RGB color value that corresponds to the
+     *  specified color string.
+     *  The color string can be either a case-insensitive color name
+     *  such as "red", "Blue", or
+     *  "haloGreen", a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+     *  such as "#FF0000".
+     *
+     *
This method returns a uint, such as 4521830, that represents a color. You can convert
+     *  this uint to a hexadecimal value by passing the numeric base (in this case, 16), to
+     *  the uint class's toString() method, as the following example shows:

+     *

+     *  import mx.styles.StyleManager;
+     *  private function getNewColorName():void {
+     *      StyleManager.registerColorName("soylentGreen",0x44FF66);
+     *      trace(StyleManager.getColorName("soylentGreen").toString(16));
+     *  }
+     *

+     *
+     *  @param colorName The color name.
+     *
+     *  @return Returns a uint that represents the color value or NOT_A_COLOR
+     *  if the value of the colorName property is not an alias for a color.
+     */
+    public function getColorName(colorName:Object):uint
+    {
+        var n:Number;
+
+        if (colorName is String)
+        {
+            if (colorName.charAt(0) == "#")
+            {
+                // Map "#77EE11" to 0x77EE11
+                n = Number("0x" + colorName.slice(1));
+                return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
+            }
+
+            if (colorName.charAt(1) == "x" && colorName.charAt(0) == '0')
+            {
+                // Map "#77EE11" to 0x77EE11
+                 n = Number(colorName);
+                return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
+            }
+
+            // Map "red" or "Red" to 0xFF0000;
+            // Map "haloGreen" or "HaLoGrEeN" to 0x46FF00.
+            var c:* = colorNames[colorName.toLowerCase()];
+            if (c === undefined)
+                return StyleManager.NOT_A_COLOR;
+
+            return uint(c);
+        }
+
+        return uint(colorName);
+    }
+
+    /**
+     *  Converts each element of the colors Array from a color name
+     *  to a numeric RGB color value.
+     *  Each color String can be either a case-insensitive color name
+     *  such as "red", "Blue", or
+     *  "haloGreen", a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+     *  such as "#FF0000"..
+     *
+     *  @param colors An Array of color names.
+     */
+    public function getColorNames(colors:Array /* of Number or String */):void
+    {
+        if (!colors)
+            return;
+
+        var n:int = colors.length;
+        for (var i:int = 0; i < n; i++)
+        {
+            if ((colors[i] != null) && isNaN(colors[i]))
+            {
+                var colorNumber:uint = getColorName(colors[i]);
+                if (colorNumber != StyleManager.NOT_A_COLOR)
+                    colors[i] = colorNumber;
+            }
+        }
+    }
+
+    /**
+     *  Determines if a specified parameter is a valid style property. For example:
+     *
+     *

+     *  trace(StyleManager.isValidStyleValue(myButton.getStyle("color")).toString());
+     *

+     *
+     *
This can be useful because some styles can be set to values
+     *  such as 0, NaN,
+     *  the empty String (""), or null, which can
+     *  cause an if (value) test to fail.

+     *
+     *  @param value The style property to test.
+     *
+     *  @return If you pass the value returned by a getStyle() method call
+     *  to this method, it returns true if the style
+     *  was set and false if it was not set.
+     *
+     */
+    public function isValidStyleValue(value:*):Boolean
+    {
+        // By convention, we don't allow style values to be undefined,
+        // so we can check for this as the "not set" value.
+        return value !== undefined;
+    }
+
+    /**
+	 *  @private
+	 */
+	public function loadStyleDeclarations(
+						url:String, update:Boolean = true,
+                        trustContent:Boolean = false):
+						IEventDispatcher
+	{
+		return loadStyleDeclarations2(url, update);
+	}
+
+    /**
+     *  Loads a style SWF.
+     *
+     *  @param url Location of the style SWF.
+     *
+     *  @param update If true, all the DisplayList trees will be updated.
+     *         The default is true.
+     *
+     *  @return An IEventDispatcher implementation that supports
+     *          StyleEvent.PROGRESS, StyleEvent.COMPLETE, and
+     *          StyleEvent.ERROR.
+     *
+     *  @see flash.system.SecurityDomain
+     */
+    public function loadStyleDeclarations2(
+						url:String, update:Boolean = true,
+						applicationDomain:ApplicationDomain = null,
+						securityDomain:SecurityDomain = null):
+						IEventDispatcher
+    {
+        var module:IModuleInfo = ModuleManager.getModule(url);
+
+        var readyHandler:Function = function(moduleEvent:ModuleEvent):void
+        {
+            var styleModule:IStyleModule =
+                IStyleModule(moduleEvent.module.factory.create());
+
+            styleModules[moduleEvent.module.url].styleModule = styleModule;
+
+            if (update)
+                styleDeclarationsChanged();
+        };
+
+        module.addEventListener(ModuleEvent.READY, readyHandler,
+                                false, 0, true);
+
+        var styleEventDispatcher:StyleEventDispatcher =
+                                        new StyleEventDispatcher(module);
+
+        var errorHandler:Function = function(moduleEvent:ModuleEvent):void
+        {
+			var errorText:String = resourceManager.getString(
+				"styles", "unableToLoad", [ moduleEvent.errorText, url ]);
+
+            if (styleEventDispatcher.willTrigger(StyleEvent.ERROR))
+            {
+                var styleEvent:StyleEvent = new StyleEvent(
+                    StyleEvent.ERROR, moduleEvent.bubbles, moduleEvent.cancelable);
+                styleEvent.bytesLoaded = 0;
+                styleEvent.bytesTotal = 0;
+                styleEvent.errorText = errorText;
+                styleEventDispatcher.dispatchEvent(styleEvent);
+            }
+            else
+            {
+                throw new Error(errorText);
+            }
+        };
+
+        module.addEventListener(ModuleEvent.ERROR, errorHandler,
+                                false, 0, true);
+
+        styleModules[url] =
+            new StyleModuleInfo(module, readyHandler, errorHandler);
+
+        // This Timer gives the loadStyleDeclarations() caller a chance
+        // to add event listeners to the return value, before the module
+        // is loaded.
+        var timer:Timer = new Timer(0);
+        var timerHandler:Function = function(event:TimerEvent):void
+        {
+            timer.removeEventListener(TimerEvent.TIMER, timerHandler);
+            timer.stop();
+            module.load(applicationDomain, securityDomain);
+        };
+
+        timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
+
+        timer.start();
+
+        return styleEventDispatcher;
+    }
+
+    /**
+     *  Unloads a style SWF.
+     *
+     *  @param url Location of the style SWF.
+     *
+     *  @param update If true, all the DisplayList trees will be updated.
+     *         The default is true.
+     */
+    public function unloadStyleDeclarations(
+                                url:String, update:Boolean = true):void
+    {
+        var styleModuleInfo:StyleModuleInfo = styleModules[url];
+        if (styleModuleInfo)
+        {
+            styleModuleInfo.styleModule.unload();
+
+            var module:IModuleInfo = styleModuleInfo.module;
+            module.unload();
+
+            module.removeEventListener(ModuleEvent.READY,
+                                       styleModuleInfo.readyHandler);
+            module.removeEventListener(ModuleEvent.ERROR,
+                                       styleModuleInfo.errorHandler);
+
+            styleModules[url] = null;
+        }
+
+        if (update)
+            styleDeclarationsChanged();
+    }
+}
+
+}
+
+import flash.events.EventDispatcher;
+import mx.events.ModuleEvent;
+import mx.events.StyleEvent;
+import mx.modules.IModuleInfo;
+import mx.styles.IStyleModule;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Helper class: StyleEventDispatcher
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  @private
+ */
+class StyleEventDispatcher extends EventDispatcher
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor
+     */
+    public function StyleEventDispatcher(moduleInfo:IModuleInfo)
+    {
+        super();
+
+        moduleInfo.addEventListener(
+            ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
+
+        moduleInfo.addEventListener(
+            ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
+
+        moduleInfo.addEventListener(
+            ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function moduleInfo_errorHandler(event:ModuleEvent):void
+    {
+        var styleEvent:StyleEvent = new StyleEvent(
+            StyleEvent.ERROR, event.bubbles, event.cancelable);
+        styleEvent.bytesLoaded = event.bytesLoaded;
+        styleEvent.bytesTotal = event.bytesTotal;
+        styleEvent.errorText = event.errorText;
+        dispatchEvent(styleEvent);
+    }
+
+    /**
+     *  @private
+     */
+    private function moduleInfo_progressHandler(event:ModuleEvent):void
+    {
+        var styleEvent:StyleEvent = new StyleEvent(
+            StyleEvent.PROGRESS, event.bubbles, event.cancelable);
+        styleEvent.bytesLoaded = event.bytesLoaded;
+        styleEvent.bytesTotal = event.bytesTotal;
+        dispatchEvent(styleEvent);
+    }
+
+    /**
+     *  @private
+     */
+    private function moduleInfo_readyHandler(event:ModuleEvent):void
+    {
+        var styleEvent:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
+        dispatchEvent(styleEvent);
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Helper class: StyleModuleInfo
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  @private
+ */
+class StyleModuleInfo
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor
+     */
+    public function StyleModuleInfo(module:IModuleInfo,
+                                    readyHandler:Function,
+                                    errorHandler:Function)
+    {
+        super();
+
+        this.module = module;
+        this.readyHandler = readyHandler;
+        this.errorHandler = errorHandler;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  errorHandler
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public var errorHandler:Function;
+
+    //----------------------------------
+    //  readyHandler
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public var readyHandler:Function;
+
+    //----------------------------------
+    //  styleModule
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public var styleModule:IStyleModule;
+
+    //----------------------------------
+    //  module
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    public var module:IModuleInfo
+}