FLEX-35362 CAUSE: the DropDownController signals that the DropDownListBase is open immediately, even before the latter has actually made that change on stage. Since the opening takes one or two frames, it leaves a few milliseconds in which code which relies on that open/closed state erroneously assumes that it can use elements that should be on stage or initialized. In this case it's the layout property, which, due to the skin of the DropDownList, is only initialized once the drop down is actually open.

SOLUTION: we check whether the layout is not-null, and if it is, we select items in the list as if it were closed.

NOTES:
-also edited some comments, simplified Array instantiation, and removed an empty constructor.
-now the unit test will pass.
diff --git a/frameworks/projects/flatspark/src/flatspark/utils/ColorUtils.as b/frameworks/projects/flatspark/src/flatspark/utils/ColorUtils.as
index 09f9cb2..e9007c3 100644
--- a/frameworks/projects/flatspark/src/flatspark/utils/ColorUtils.as
+++ b/frameworks/projects/flatspark/src/flatspark/utils/ColorUtils.as
@@ -45,15 +45,10 @@
 		public static const Concrete:uint = 0x95A5A6;
 		public static const Asbestos:uint = 0x7F8C8D;
 		
-		public function ColorUtils()
-		{
-			
-		}		
-		
 		public static function ButtonColor(brand:int, estado:State):uint
 		{
 			// All the possible colors
-			var cores:Array = new Array(
+			var cores:Array = [
 				ButtonColorEnum.PrimaryUp, ButtonColorEnum.PrimaryHover, ButtonColorEnum.PrimaryDown, ButtonColorEnum.PrimaryDisabled,
 				ButtonColorEnum.SuccessUp, ButtonColorEnum.SuccessHover, ButtonColorEnum.SuccessDown, ButtonColorEnum.SuccessDisabled,
 				ButtonColorEnum.WarningUp, ButtonColorEnum.WarningHover, ButtonColorEnum.WarningDown, ButtonColorEnum.WarningDisabled,
@@ -61,7 +56,7 @@
 				ButtonColorEnum.DefaultUp, ButtonColorEnum.DefaultHover, ButtonColorEnum.DefaultDown, ButtonColorEnum.DefaultDisabled,
 				ButtonColorEnum.InfoUp, ButtonColorEnum.InfoHover, ButtonColorEnum.InfoDown, ButtonColorEnum.InfoDisabled,
 				ButtonColorEnum.DangerUp, ButtonColorEnum.DangerHover, ButtonColorEnum.DangerDown, ButtonColorEnum.DangerDisabled
-				);
+				];
 			
 			// Map all the allowed states
 			var numeroEstado:int = 1;
@@ -80,11 +75,8 @@
 					numeroEstado = 3;
 					break;
 			}
-			
-			var posicao:int = 1;
-			posicao = 4 * (brand - 1) + (numeroEstado - 1); 
-			
-			return cores[posicao];
+
+			return cores[4 * (brand - 1) + (numeroEstado - 1)];
 		}
 	}
 }
\ No newline at end of file
diff --git a/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as b/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
index aaba442..c80c2b4 100644
--- a/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
+++ b/frameworks/projects/spark/src/spark/components/supportClasses/DropDownListBase.as
@@ -900,7 +900,7 @@
             var proposedNewIndex:int = NO_SELECTION;
             var currentIndex:int;
                         
-            if (isDropDownOpen)
+            if (isDropDownOpen && layout)
             {   
                 // Normalize the proposed index for getNavigationDestinationIndex
                 currentIndex = userProposedSelectedIndex < NO_SELECTION ? NO_SELECTION : userProposedSelectedIndex;
@@ -992,7 +992,6 @@
         {
             event.preventDefault();
         }
-        
     }
     
     /**
diff --git a/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as b/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
index e700d0d..fbe1050 100644
--- a/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
+++ b/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
@@ -1877,9 +1877,9 @@
         
         // We want to wait one frame after validation has occured before turning off 
         // selection transitions again.  We tried using dataGroup's updateComplete event listener, 
-        // but because some validateNows() occur (before all of the event handling code has finished), 
-        // this was occuring too early.  We also tried just using callLater or ENTER_FRAME, but that 
-        // occurs before the LayoutManager has run, so we add an ENTER_FRAME handler with a 
+        // but because some validateNow() calls occur (before all of the event handling code has
+        // finished), this was occurring too early.  We also tried just using callLater or ENTER_FRAME,
+        // but that occurs before the LayoutManager has run, so we add an ENTER_FRAME handler with a
         // low priority to make sure it occurs after the LayoutManager pass.
         systemManager.addEventListener(Event.ENTER_FRAME, allowSelectionTransitions_enterFrameHandler, false, -100);
     }